Add some extra logging output
authorMarcel Holtmann <marcel@holtmann.org>
Wed, 22 Jul 2009 12:45:04 +0000 (14:45 +0200)
committerMarcel Holtmann <marcel@holtmann.org>
Wed, 22 Jul 2009 12:45:04 +0000 (14:45 +0200)
src/log.c
src/main.c

index 3a87b93..1651f38 100644 (file)
--- a/src/log.c
+++ b/src/log.c
@@ -92,10 +92,13 @@ void connman_debug(const char *format, ...)
 
 void __connman_toggle_debug(void)
 {
-       if (debug_enabled == TRUE)
+       if (debug_enabled == TRUE) {
+               connman_info("Disabling debug output");
                debug_enabled = FALSE;
-       else
+       } else {
+               connman_info("Enabling debug output");
                debug_enabled = TRUE;
+       }
 }
 
 int __connman_log_init(gboolean detach, gboolean debug)
@@ -109,7 +112,8 @@ int __connman_log_init(gboolean detach, gboolean debug)
 
        syslog(LOG_INFO, "Connection Manager version %s", VERSION);
 
-       debug_enabled = debug;
+       if (debug == TRUE)
+               __connman_toggle_debug();
 
        return 0;
 }
index fe41183..7793938 100644 (file)
@@ -40,6 +40,8 @@ static GMainLoop *main_loop = NULL;
 
 static void sig_term(int sig)
 {
+       connman_info("Terminating");
+
        g_main_loop_quit(main_loop);
 }