diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2011-08-15 16:07:28 -0700 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2011-08-15 16:07:28 -0700 |
commit | 095049e6721148cb3dbd405c12316f13edc2dd4e (patch) | |
tree | a03dd1a2a3bb36c4332506efe60d8aa2b9cde70b /src/log.c | |
parent | a94bafe59b43255a7309bf54ca4536845004a9d9 (diff) | |
download | connman-095049e6721148cb3dbd405c12316f13edc2dd4e.tar.gz connman-095049e6721148cb3dbd405c12316f13edc2dd4e.tar.bz2 connman-095049e6721148cb3dbd405c12316f13edc2dd4e.zip |
log: Use separate function for enable logging
Diffstat (limited to 'src/log.c')
-rw-r--r-- | src/log.c | 20 |
1 files changed, 15 insertions, 5 deletions
@@ -195,16 +195,16 @@ static connman_bool_t is_enabled(struct connman_debug_desc *desc) return FALSE; } -int __connman_log_init(const char *debug, connman_bool_t detach) +void __connman_log_enable(struct connman_debug_desc *start, + struct connman_debug_desc *stop) { - int option = LOG_NDELAY | LOG_PID; struct connman_debug_desc *desc; const char *name = NULL, *file = NULL; - if (debug != NULL) - enabled = g_strsplit_set(debug, ":, ", 0); + if (start == NULL || stop == NULL) + return; - for (desc = __start___debug; desc < __stop___debug; desc++) { + for (desc = start; desc < stop; desc++) { if (desc->flags & CONNMAN_DEBUG_FLAG_ALIAS) { file = desc->file; name = desc->name; @@ -222,6 +222,16 @@ int __connman_log_init(const char *debug, connman_bool_t detach) if (is_enabled(desc) == TRUE) desc->flags |= CONNMAN_DEBUG_FLAG_PRINT; } +} + +int __connman_log_init(const char *debug, connman_bool_t detach) +{ + int option = LOG_NDELAY | LOG_PID; + + if (debug != NULL) + enabled = g_strsplit_set(debug, ":, ", 0); + + __connman_log_enable(__start___debug, __stop___debug); if (detach == FALSE) option |= LOG_PERROR; |