Enhance debug message
[platform/core/connectivity/bluetooth-frwk.git] / bt-service / bt-service-main.c
index 8006b74..46f7940 100644 (file)
@@ -36,6 +36,12 @@ static GMainLoop *main_loop;
 static gboolean terminated = FALSE;
 static gboolean is_initialized = FALSE;
 
+static void __on_log_glib(const gchar *log_domain, GLogLevelFlags log_level,
+               const gchar *msg, gpointer user_data)
+{
+       BT_ERR_C("%s", msg);
+}
+
 static void __bt_release_service(void)
 {
        _bt_service_unregister_vconf_handler();
@@ -105,7 +111,7 @@ gboolean _bt_reliable_terminate_service(gpointer user_data)
 
        terminated = TRUE;
 
-       BT_INFO_C("Terminating the bt-service daemon");
+       BT_INFO_C("### Terminating the bt-service daemon");
 
        if (main_loop != NULL)
                g_main_loop_quit(main_loop);
@@ -272,6 +278,8 @@ int main(void)
                return 0;
        }
 
+       g_log_set_default_handler(__on_log_glib, NULL);
+
        main_loop = g_main_loop_new(NULL, FALSE);
 
        g_main_loop_run(main_loop);