events: Add a warning event and direct all warning messages through it.

This also causes warnings to be printed even in non-verbose mode,
which is useful.
This commit is contained in:
Richard W.M. Jones
2013-10-11 14:35:12 +01:00
parent aada08a91c
commit 92e1864913
12 changed files with 42 additions and 22 deletions

View File

@@ -34,7 +34,8 @@ def log_callback (ev,eh,buf,array):
(guestfs.event_to_string (ev), eh, buf, array))
# Register an event callback for all log messages.
events = guestfs.EVENT_APPLIANCE | guestfs.EVENT_LIBRARY | guestfs.EVENT_TRACE
events = guestfs.EVENT_APPLIANCE | guestfs.EVENT_LIBRARY \
| guestfs.EVENT_WARNING | guestfs.EVENT_TRACE
g.set_event_callback (log_callback, events)
# Now make sure we see some messages.