[gnome-calendar/wip/flb/weather-forecast: 7/50] weather: Improve logging



commit d56e93953e8d99d7d7297e34bdd7ca8f6f8abb1a
Author: Florian Brosch <flo brosch gmail com>
Date:   Thu Oct 12 23:51:57 2017 +0200

    weather: Improve logging

 src/gcal-weather-service.c |   17 +++++++++++++----
 1 files changed, 13 insertions(+), 4 deletions(-)
---
diff --git a/src/gcal-weather-service.c b/src/gcal-weather-service.c
index 1d7ae14..c3cf251 100644
--- a/src/gcal-weather-service.c
+++ b/src/gcal-weather-service.c
@@ -516,7 +516,7 @@ preprocess_gweather_reports (GcalWeatherService *self,
         }
       else
         {
-          g_info ("Received historic weather information.");
+          g_debug ("Encountered historic weather information");
         }
     }
 
@@ -572,11 +572,14 @@ gcal_weather_service_update_location (GcalWeatherService  *self,
 
   if (location == NULL)
     {
-      g_info ("Could not retrieve current location.");
+      g_debug ("Could not retrieve current location");
       gcal_weather_service_update_weather (NULL, self);
     }
   else
     {
+      g_debug ("Got new weather service location: '%s'",
+               (location == NULL)? "<null>" : gweather_location_get_name (location));
+
       self->weather_info = gweather_info_new (location, GWEATHER_FORECAST_ZONE | GWEATHER_FORECAST_LIST);
       /* TODO: display weather attributions somewhere:
        * gweather_info_get_attribution (self->weather_info);
@@ -844,19 +847,21 @@ gcal_weather_service_update_weather (GWeatherInfo       *info,
   /* Compute a list of weather infos. */
   if (info == NULL)
     {
-      g_info ("Could not retrieve valid weather");
+      g_debug ("Could not retrieve valid weather");
     }
   else if (gweather_info_is_valid (info))
     {
       GSList *gwforecast; /* unowned */
 
+      g_debug ("Received valid weather information");
+
       gwforecast = gweather_info_get_forecast_list (info);
       gcinfos = preprocess_gweather_reports (self, gwforecast);
     }
   else
     {
       g_autofree gchar* location_name = gweather_info_get_location_name (info);
-      g_info ("Could not retrieve valid weather for location '%s'", location_name);
+      g_debug ("Could not retrieve valid weather for location '%s'", location_name);
     }
 
   g_signal_emit (self, gcal_weather_service_signals[SIG_WEATHER_CHANGED], 0, gcinfos);
@@ -998,6 +1003,8 @@ gcal_weather_service_run (GcalWeatherService *self,
 {
   g_return_if_fail (GCAL_IS_WEATHER_SERVICE (self));
 
+  g_debug ("Start weather service");
+
   if (self->location_service_running || self->weather_service_running)
     gcal_weather_service_stop (self);
 
@@ -1039,6 +1046,8 @@ gcal_weather_service_stop (GcalWeatherService *self)
 {
   g_return_if_fail (GCAL_IS_WEATHER_SERVICE (self));
 
+  g_debug ("Stop weather service");
+
   if (!self->location_service_running && !self->weather_service_running)
     return ;
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]