diff options
author | Marcel Holtmann <marcel.holtmann@intel.com> | 2009-05-05 18:56:46 -0700 |
---|---|---|
committer | Marcel Holtmann <marcel.holtmann@intel.com> | 2009-05-05 18:56:46 -0700 |
commit | 488463da5a34ac6b44a28f322009710de032db98 (patch) | |
tree | c8eea4fbef52688462ae17beb4a287240456da29 | |
parent | ed6c14243ded4653195d0a1d5028e643f40f6fe5 (diff) | |
download | ofono-488463da5a34ac6b44a28f322009710de032db98.tar.bz2 |
Update log and plugin functions
-rw-r--r-- | include/log.h | 9 | ||||
-rw-r--r-- | include/plugin.h | 2 | ||||
-rw-r--r-- | src/log.c | 17 | ||||
-rw-r--r-- | src/plugin.c | 2 |
4 files changed, 22 insertions, 8 deletions
diff --git a/include/log.h b/include/log.h index cdd3b0f5..47e5ec88 100644 --- a/include/log.h +++ b/include/log.h @@ -32,9 +32,12 @@ extern "C" { * @short_description: Functions for logging error and debug information */ -extern void ofono_info(const char *format, ...); -extern void ofono_error(const char *format, ...); -extern void ofono_debug(const char *format, ...); +extern void ofono_info(const char *format, ...) + __attribute__((format(printf, 1, 2))); +extern void ofono_error(const char *format, ...) + __attribute__((format(printf, 1, 2))); +extern void ofono_debug(const char *format, ...) + __attribute__((format(printf, 1, 2))); /** * DBG: diff --git a/include/plugin.h b/include/plugin.h index 4b01ad43..7c133e39 100644 --- a/include/plugin.h +++ b/include/plugin.h @@ -1,6 +1,6 @@ /* * - * oFono - Open Telephony stack for Linux + * oFono - Open Source Telephony * * Copyright (C) 2008-2009 Intel Corporation. All rights reserved. * @@ -1,6 +1,6 @@ /* * - * oFono - Open Telephony stack for Linux + * oFono - Open Source Telephony * * Copyright (C) 2008-2009 Intel Corporation. All rights reserved. * @@ -90,15 +90,26 @@ void ofono_debug(const char *format, ...) va_end(ap); } -int __ofono_log_init(void) +void __ofono_toggle_debug(void) +{ + if (debug_enabled == TRUE) + debug_enabled = FALSE; + else + debug_enabled = TRUE; +} + +int __ofono_log_init(gboolean detach, gboolean debug) { int option = LOG_NDELAY | LOG_PID; + if (detach == FALSE) + option |= LOG_PERROR; + openlog("ofonod", option, LOG_DAEMON); syslog(LOG_INFO, "oFono version %s", VERSION); - debug_enabled = TRUE; + debug_enabled = debug; return 0; } diff --git a/src/plugin.c b/src/plugin.c index 9fdb3325..9822359f 100644 --- a/src/plugin.c +++ b/src/plugin.c @@ -1,6 +1,6 @@ /* * - * oFono - Open Telephony stack for Linux + * oFono - Open Source Telephony * * Copyright (C) 2008-2009 Intel Corporation. All rights reserved. * |