[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [MirageOS-devel] Logs



> On 16 Oct 2015, at 10:55, Daniel BÃnzli <daniel.buenzli@xxxxxxxxxxxx> wrote:
> 
> Hello,  
> 
> The topic was mentioned again on the mirage call. I also need such a library 
> in many different contexts and I keep on rewriting the bits of a basic logger 
> in too many of my projects.  
> 
> I do have a Log module in bos [1] which represents the very basics I'd like, 
> but I would like to fork it and expand it a bit to make it more useful in 
> different contexts and independent of bos â as it doesn't depend on it and 
> I'd like for example to be able to use the same interface in js to log to the 
> browser console (see e.g. [2]). Here's roughly what I have in mind:
> 
> * Format based.
> * Simple fixed levels [3].
> * Interaction with result type [4].
> * Notion of logging source and per source log level control. Sources should 
> be listable (for ui purposes).
> * Decoupling of log generation (logging function calls) and reporting (log 
> output/rendering).  
> * A few reporting profiles as optional subpackages, for a cli, for js, etc.

I really like this library except for the notion of log levels.  One issue with 
that is that I never quite know what levels to put in (is it Info or Debug or a 
Warning), and also that the lower level debug levels are almost always more 
useful if they're lazy, so that the arguments are not expensively evaluated.

Do you think it's worth having an ultra simple level-free signature that is 
just 

val msg : ('a, Format.formatter, unit, unit) Pervasives.format4 -> 'a

that could be passed around libraries as an argument, with the level stuff 
added by a higher level logger/monitor?

-anil
_______________________________________________
MirageOS-devel mailing list
MirageOS-devel@xxxxxxxxxxxxxxxxxxxx
http://lists.xenproject.org/cgi-bin/mailman/listinfo/mirageos-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.