From 488463da5a34ac6b44a28f322009710de032db98 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 5 May 2009 18:56:46 -0700 Subject: Update log and plugin functions --- src/log.c | 17 ++++++++++++++--- src/plugin.c | 2 +- 2 files changed, 15 insertions(+), 4 deletions(-) (limited to 'src') diff --git a/src/log.c b/src/log.c index d79c99fb..273e3ba0 100644 --- a/src/log.c +++ b/src/log.c @@ -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. * -- cgit v1.2.3