[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [MirageOS-devel] Logs
On 17 October 2015 at 15:04, Daniel BÃnzli <daniel.buenzli@xxxxxxxxxxxx> wrote: > Le samedi, 17 octobre 2015 Ã 12:49, Thomas Leonard a Ãcrit : >> (but OCaml libraries don't generally do any logging at all, so it's not a >> huge issue). > > And this tradition should continue as much as possible. > >> Makes sense (I'd expect it to go between warning and info - I can >> imagine wanting to suppress progress without suppressing errors). > > It doesn't really match what I expect from this level which I really see like > the stdout of you program. So I'd like to be able to redirect the output of > the program without e.g. getting errors or warnings in the output. Thinking on about this, I don't think it makes sense to have a log level that goes to stdout by default. All libraries can log, but they shouldn't be able to write to the program's output. e.g. consider: curl URL > file.html If some library wants to make sure the user sees a message (Log.show "Connected!" or something), that should go to stderr, where the use will see it, not to stdout where the downloaded HTML is being written. > For me it is also distinct from the info level which I'd use to inform a bit > more about what is happening internally in the program. Yes, a log level for messages that are more important than info (should be shown by default even in interactive applications) but do not indicate problems sounds reasonable. "Log.notice" still sounds right to me for this. > Of course you could use a special log source for that but then you'd need to > devise a special log reporter for that, so I prefer if all the reporters have > to acknowledge the existence of that level and its supposed semantics. I think anything that writes to stdout should need explicit configuration from the application. > So for now I have kept that as the lowest level and renamed it to `App` > rather than `Show`. I may still kill the concept though. > > Daniel > > -- Dr Thomas Leonard http://roscidus.com/blog/ GPG: DA98 25AE CAD0 8975 7CDA BD8E 0713 3F96 CA74 D8BA _______________________________________________ MirageOS-devel mailing list MirageOS-devel@xxxxxxxxxxxxxxxxxxxx http://lists.xenproject.org/cgi-bin/mailman/listinfo/mirageos-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |