summaryrefslogtreecommitdiffstats
path: root/common/log.h
Commit message (Collapse)AuthorAgeFilesLines
* log: Kill spice_warn_ifChristophe Fergeau2016-01-261-6/+0
| | | | | | It's redundant with spice_warn_if_fail(), and can even be confusing. Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
* log: Use glib for loggingChristophe Fergeau2016-01-261-7/+0
| | | | | | | | | | | | | spice-common has been duplicating glib logging methods for a long while. Now that spice-common is depending on glib, it's more consistent to use glib logging too. However, the code base is still using spice logging functions. This commit aims to make spice logging go through glib logging system, while keeping the same behaviour for the SPICE_ABORT_LEVEL and SPICE_DEBUG_LEVEL environment variables. They are deprecated however in favour of the glib alternatives (G_DEBUG and G_MESSAGES_DEBUG). Reviewed-by: Jonathon Jongsma <jjongsma@redhat.com>
* log: Remove unneeded #ifdef/#endifChristophe Fergeau2016-01-261-26/+0
| | | | | | | | | If header guards are working as expected, there should not be multiple definitions of these macros. If they are redefined somewhere else, this is a bug we want to fix. Acked-by: Frediano Ziglio <fziglio@redhat.com> Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
* log: Use more glib macrosChristophe Fergeau2016-01-211-34/+33
| | | | | | No need to have our own SPICE_STMT_BEGIN/END and SPICE_STRINGIFY Acked-by: Jonathon Jongsma <jjongsma@redhat.com>
* common/log.h: add spice_infoAlon Levy2012-07-051-0/+6
|
* Add printf format annotations to all '...' functionsDaniel P. Berrange2012-03-201-2/+3
| | | | | | | | | | To allow the compile to detect incorrect printf formats, any var-args function should have a format annotation * common/macros.h: Helper to define ATTR_PRINTF for code which can't depend on glib * common/canvas_base.c, common/lz.h, common/macros.h: Annotate some var-args methods
* Use a log handler to modify abort() behaviourMarc-André Lureau2012-03-201-0/+144
Be more library friendly, by not aborting in library errors. spice_common now includes a proper log handler that will abort by default when reaching a warning. SPICE_ABORT_LEVEL can be changed to modify run-time abort level. SPICE_DEBUG_LEVEL can be changed to be more verbose. By default, only log level more importants than WARNING. Only memory-related functions are allowed to abort(), since they are not recoverable errors in the library.