logging: split out enum type definition for LogBackend

This commit is contained in:
Thomas Haller 2019-01-15 17:49:52 +01:00
parent 8dcc3cd51a
commit eea11faf9a

View file

@ -53,6 +53,12 @@ typedef struct {
const char *name;
} LogDesc;
typedef enum {
LOG_BACKEND_GLIB,
LOG_BACKEND_SYSLOG,
LOG_BACKEND_JOURNAL,
} LogBackend;
typedef struct {
const char *name;
const char *level_str;
@ -86,17 +92,15 @@ static struct Global {
bool debug_stderr:1;
const char *prefix;
const char *syslog_identifier;
enum {
/* before we setup syslog (during start), the backend defaults to GLIB, meaning:
* we use g_log() for all logging. At that point, the application is not yet supposed
* to do any logging and doing so indicates a bug.
*
* Afterwards, the backend is either SYSLOG or JOURNAL. From that point, also
* g_log() is redirected to this backend via a logging handler. */
LOG_BACKEND_GLIB,
LOG_BACKEND_SYSLOG,
LOG_BACKEND_JOURNAL,
} log_backend;
/* before we setup syslog (during start), the backend defaults to GLIB, meaning:
* we use g_log() for all logging. At that point, the application is not yet supposed
* to do any logging and doing so indicates a bug.
*
* Afterwards, the backend is either SYSLOG or JOURNAL. From that point, also
* g_log() is redirected to this backend via a logging handler. */
LogBackend log_backend;
char *logging_domains_to_string;
} global = {
/* nm_logging_setup ("INFO", LOGD_DEFAULT_STRING, NULL, NULL); */