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

Re: [Libguestfs] Callbacks, log messages etc.



Hi Rich,

On 2010-12-22, at 18:24, Richard W.M. Jones wrote:

> Here's my proposed more usable solution:
> 
>  (i) Each event has a single class, one of:
>      { LOG, VERBOSE, TRACE, SUBPROCESS_QUIT, LAUNCH_DONE, CLOSE, PROGRESS }

What is a LOG event? Is it an INFO level? What do you think about standard(?) log levels: INFO, DEBUG, TRACE?

> 
> (ii) Give each event a level (an integer).
> 
> (iii) Each event can optionally have some content.  For log messages this
>      is a string with length, for progress messages it is a struct
>      of numbers.

SNIP

> we should have:
> 
>  debug ("...");
> 
> where the debug message is converted to a verbose level event if
> g->verbose is set, otherwise it is discarded.  If no handler has been
> registered for debug messages, they should go to stderr as they do
> now, otherwise they should go to handlers only.
> 
> A similar thing should happen for trace messages.

This is definitely what I'm looking for. If someone uses libguestfs bindings (like me) there is an assumption the library will act as library and provide some way of capturing the log messages instead of displaying it on stderr or stdout.

--Marek



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