diff options
author | David Sommerseth <davids@redhat.com> | 2010-02-05 15:33:39 +0100 |
---|---|---|
committer | David Sommerseth <davids@redhat.com> | 2010-02-05 15:33:39 +0100 |
commit | 5ebf67efee2893c4d3dc60ec31a0efeb0894d245 (patch) | |
tree | 337c4ff23b1498096e64179dadddf8b39a81e340 /src/dmilog.h | |
parent | 24af40698f1486c899333ea1f129e87590cdee7e (diff) | |
download | python-dmidecode-5ebf67efee2893c4d3dc60ec31a0efeb0894d245.tar.gz python-dmidecode-5ebf67efee2893c4d3dc60ec31a0efeb0894d245.tar.xz python-dmidecode-5ebf67efee2893c4d3dc60ec31a0efeb0894d245.zip |
Added logging flag to log_append() to change log behaviour
Valid flags are:
* LOGFL_NORMAL
Log all messages to the log context, and send log message to stderr
on errors
* LOGFL_NODUPS
Log only unique messages. Duplicated messages will be removed
* LOGFL_NOSTDERR
Don't write to stderr, even if errors occur
Diffstat (limited to 'src/dmilog.h')
-rw-r--r-- | src/dmilog.h | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/dmilog.h b/src/dmilog.h index 98d0780..76c87b6 100644 --- a/src/dmilog.h +++ b/src/dmilog.h @@ -46,8 +46,16 @@ struct _Log_t { }; typedef struct _Log_t Log_t; +/** + * Log flags. These flags can be OR'ed together + */ +typedef enum { LOGFL_NORMAL = 1, /**< Normal behaviour, log everything and use stderr on errors */ + LOGFL_NODUPS = 2, /**< Don't log messages we already have logged */ + LOGFL_NOSTDERR = 4 /**< Don't use stderr even if log functions fails */ +} Log_f; + Log_t * log_init(); -int log_append(Log_t *logp, int level, const char *fmt, ...); +int log_append(Log_t *logp, Log_f flags, int level, const char *fmt, ...); char * log_retrieve(Log_t *logp, int level); size_t log_clear_partial(Log_t *logp, int level, int unread); void log_close(Log_t *logp); |