[libgweather/gnome-3-36] metar: Add some debug info about parsing



commit 63ea891ced18777ef702a20fda788eb4a32fca46
Author: Bastien Nocera <hadess hadess net>
Date:   Fri Jun 19 12:21:08 2020 +0200

    metar: Add some debug info about parsing

 libgweather/weather-metar.c | 7 +++++++
 1 file changed, 7 insertions(+)
---
diff --git a/libgweather/weather-metar.c b/libgweather/weather-metar.c
index fad2f2f9..f58b87a4 100644
--- a/libgweather/weather-metar.c
+++ b/libgweather/weather-metar.c
@@ -623,12 +623,19 @@ metar_finish (SoupSession *session, SoupMessage *msg, gpointer data)
            metar = g_strdup (p);
        success = metar_parse (metar, info);
        g_free (metar);
+       if (success)
+         g_debug ("Successfully parsed METAR for %s", loc->code);
+       else
+         g_debug ("Failed to parse raw_text METAR for %s", loc->code);
     } else if (!strstr (msg->response_body->data, "aviationweather.gov")) {
        /* The response doesn't even seem to have come from NOAA...
         * most likely it is a wifi hotspot login page. Call that a
         * network error.
         */
        priv->network_error = TRUE;
+       g_debug ("Response to query for %s did not come from correct server", loc->code);
+    } else {
+      g_debug ("Failed to parse METAR for %s", loc->code);
     }
 
     g_free (searchkey);


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