diff options
author | Luiz Augusto von Dentz <luiz.dentz-von@nokia.com> | 2010-12-07 17:01:00 +0200 |
---|---|---|
committer | Johan Hedberg <johan.hedberg@nokia.com> | 2010-12-07 17:23:07 +0200 |
commit | c96a9d08d11eb92b56baa08e1a9547990184b452 (patch) | |
tree | d02ce5767919cc4b2e7d2cafae8d61361c61367e /src | |
parent | 23fd0b08468a9c5308350e4c3d843775b23e2c48 (diff) | |
download | obexd-c96a9d08d11eb92b56baa08e1a9547990184b452.tar.gz |
Fix logging for obex-client
Since obex-client and obexd share the same log code they both were using
obexd for openlog which makes it very confusing when reading the logs.
To fix this now __obex_log_init takes the binary name so that each daemon
can be properly labeled.
Diffstat (limited to 'src')
-rw-r--r-- | src/log.c | 6 | ||||
-rw-r--r-- | src/log.h | 2 | ||||
-rw-r--r-- | src/main.c | 2 |
3 files changed, 5 insertions, 5 deletions
@@ -100,7 +100,7 @@ void __obex_log_enable_debug() desc->flags |= OBEX_DEBUG_FLAG_PRINT; } -void __obex_log_init(const char *debug, int detach) +void __obex_log_init(const char *label, const char *debug, int detach) { int option = LOG_NDELAY | LOG_PID; struct obex_debug_desc *desc; @@ -125,9 +125,9 @@ void __obex_log_init(const char *debug, int detach) if (!detach) option |= LOG_PERROR; - openlog("obexd", option, LOG_DAEMON); + openlog(label, option, LOG_DAEMON); - syslog(LOG_INFO, "OBEX daemon %s", VERSION); + syslog(LOG_INFO, "%s daemon %s", label, VERSION); } void __obex_log_cleanup(void) @@ -26,7 +26,7 @@ void error(const char *format, ...) __attribute__((format(printf, 1, 2))); void obex_debug(const char *format, ...) __attribute__((format(printf, 1, 2))); -void __obex_log_init(const char *debug, int detach); +void __obex_log_init(const char *label, const char *debug, int detach); void __obex_log_cleanup(void); void __obex_log_enable_debug(void); @@ -218,7 +218,7 @@ int main(int argc, char *argv[]) exit(EXIT_FAILURE); } - __obex_log_init(option_debug, option_detach); + __obex_log_init("obexd", option_debug, option_detach); DBG("Entering main loop"); |