[Libguestfs] Callbacks, log messages etc.

Marek Goldmann mgoldmann at redhat.com
Wed Jan 5 09:26:08 UTC 2011


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





More information about the Libguestfs mailing list