Replace g_debug/g_warning calls with DLT logging
authorJannis Pohlmann <jannis.pohlmann@codethink.co.uk>
Wed, 1 Aug 2012 11:37:08 +0000 (12:37 +0100)
committerJannis Pohlmann <jannis.pohlmann@codethink.co.uk>
Wed, 1 Aug 2012 11:37:08 +0000 (12:37 +0100)
node-startup-controller/luc-starter.c
nsm-dummy/main.c

index 637523d..d1a1e23 100644 (file)
@@ -339,7 +339,8 @@ luc_starter_start_next_group (LUCStarter *starter)
   /* fetch the next group */
   group = g_array_index (starter->start_order, gint, 0);
 
-  g_debug ("start group %i", group);
+  DLT_LOG (controller_context, DLT_LOG_INFO,
+           DLT_STRING ("Starting LUC group: "), DLT_INT (group));
 
   /* look up the apps for the group */
   apps = g_hash_table_lookup (starter->start_groups, GINT_TO_POINTER (group));
@@ -361,7 +362,8 @@ luc_starter_start_app (const gchar *app,
   g_return_if_fail (app != NULL && *app != '\0');
   g_return_if_fail (IS_LUC_STARTER (starter));
 
-  g_debug ("start app '%s'", app);
+  DLT_LOG (controller_context, DLT_LOG_INFO,
+           DLT_STRING ("Starting LUC app: "), DLT_STRING (app));
 
   /* create the new cancellable */
   cancellable = g_cancellable_new ();
@@ -397,7 +399,8 @@ luc_starter_start_app_finish (JobManager  *manager,
   g_return_if_fail (IS_LUC_STARTER (user_data));
   g_return_if_fail (starter->start_order->len > 0);
 
-  g_debug ("start app '%s' finish", unit);
+  DLT_LOG (controller_context, DLT_LOG_INFO,
+           DLT_STRING ("Finished starting LUC app: "), DLT_STRING (unit));
 
   /* respond to errors */
   if (error != NULL)
@@ -429,7 +432,8 @@ luc_starter_start_app_finish (JobManager  *manager,
       /* check if this was the last app in the group to be started */
       if (apps->len == 0)
         {
-          g_debug ("start group %i finish", group);
+          DLT_LOG (controller_context, DLT_LOG_INFO,
+                   DLT_STRING ("Finished starting LUC group: "), DLT_INT (group));
 
           /* remove the group from the groups and the order */
           g_hash_table_remove (starter->start_groups, GINT_TO_POINTER (group));
@@ -515,8 +519,7 @@ luc_starter_check_luc_required_finish (GObject      *object,
       else
         {
           /* LUC is not required, log this information */
-          DLT_LOG (controller_context, DLT_LOG_INFO,
-                   DLT_STRING ("LUC is not required"));
+          DLT_LOG (controller_context, DLT_LOG_INFO, DLT_STRING ("LUC is not required"));
 
           /* notify others that we have started the LUC groups; we haven't
            * in this case but the call of luc_starter_start_groups() may
@@ -546,10 +549,13 @@ luc_starter_start_groups_for_real (LUCStarter *starter)
 
   g_return_if_fail (IS_LUC_STARTER (starter));
 
-  /* to load the LUC is required */
-  g_debug ("prioritised types:");
+  /* log prioritised LUC types */
+  DLT_LOG (controller_context, DLT_LOG_INFO, DLT_STRING ("Prioritised LUC types:"));
   for (n = 0; n < starter->prioritised_types->len; n++)
-    g_debug ("  %i", g_array_index (starter->prioritised_types, gint, n));
+    {
+      DLT_LOG (controller_context, DLT_LOG_INFO,
+               DLT_INT (g_array_index (starter->prioritised_types, gint, n)));
+    }
 
   /* clear the start order */
   if (starter->start_order->len > 0)
@@ -598,9 +604,12 @@ luc_starter_start_groups_for_real (LUCStarter *starter)
     }
   g_array_sort_with_data (starter->start_order, luc_starter_compare_luc_types, starter);
 
-  g_debug ("start groups (ordered):");
+  DLT_LOG (controller_context, DLT_LOG_INFO, DLT_STRING ("LUC start groups (ordered):"));
   for (n = 0; n < starter->start_order->len; n++)
-    g_debug ("  %i", g_array_index (starter->start_order, gint, n));
+    {
+      DLT_LOG (controller_context, DLT_LOG_INFO,
+               DLT_INT (g_array_index (starter->start_order, gint, n)));
+    }
 
   if (starter->start_order->len > 0)
     luc_starter_start_next_group (starter);
index ad35fa6..fdb96e1 100644 (file)
@@ -65,7 +65,9 @@ main (int    argc,
   connection = g_bus_get_sync (G_BUS_TYPE_SYSTEM, NULL, &error);
   if (connection == NULL)
     {
-      g_warning ("Failed to connect to D-Bus: %s", error->message);
+      DLT_LOG (nsm_dummy_context, DLT_LOG_FATAL,
+               DLT_STRING ("Failed to connect to D-Bus: "),
+               DLT_STRING (error->message));
 
       /* clean up */
       g_error_free (error);
@@ -77,7 +79,9 @@ main (int    argc,
   lifecycle_control_service = nsm_lifecycle_control_service_new (connection);
   if (!nsm_lifecycle_control_service_start (lifecycle_control_service, &error))
     {
-      g_warning ("Failed to start the LifecycleControl service: %s", error->message);
+      DLT_LOG (nsm_dummy_context, DLT_LOG_FATAL,
+               DLT_STRING ("Failed to start the lifecycle control service: "),
+               DLT_STRING (error->message));
 
       /* clean up */
       g_error_free (error);
@@ -91,7 +95,9 @@ main (int    argc,
   consumer_service = nsm_consumer_service_new (connection);
   if (!nsm_consumer_service_start (consumer_service, &error))
     {
-      g_warning ("Failed to start the Consumer service: %s", error->message);
+      DLT_LOG (nsm_dummy_context, DLT_LOG_FATAL,
+               DLT_STRING ("Failed to start the consumer service: "),
+               DLT_STRING (error->message));
 
       /* clean up */
       g_error_free (error);