Replaced every g_warning() with g_log()
authorMikael Berthe <mikael@lilotux.net>
Wed, 17 Feb 2010 23:53:20 +0100
changeset 614 773201ca404c
parent 613 174c17adc1e7
child 615 9a0fa0dabcdf
Replaced every g_warning() with g_log() This fixes display errors when using ncurses. committer: Frank Zschockelt <lm@freakysoft.de>
loudmouth/lm-asyncns-resolver.c
loudmouth/lm-connection.c
loudmouth/lm-sasl.c
loudmouth/lm-ssl-openssl.c
--- a/loudmouth/lm-asyncns-resolver.c	Wed Feb 10 11:59:07 2010 +0100
+++ b/loudmouth/lm-asyncns-resolver.c	Wed Feb 17 23:53:20 2010 +0100
@@ -208,7 +208,7 @@
     req.ai_protocol = IPPROTO_TCP;
 
     if (!asyncns_resolver_prep (resolver, NULL)) {
-        g_warning ("Signal error\n");
+        g_log (LM_LOG_DOMAIN, LM_LOG_LEVEL_NET, "Signal error\n");
         return;
     }
 
@@ -240,7 +240,8 @@
 
     if (srv_len <= 0) {
         /* FIXME: Report error */
-        g_warning ("Failed to read srv request results");
+        g_log (LM_LOG_DOMAIN, LM_LOG_LEVEL_NET,
+               "Failed to read srv request results");
     } else {
         gchar *new_server;
         guint  new_port;
@@ -299,7 +300,8 @@
            domain, service, protocol, srv);
 
     if (!asyncns_resolver_prep (resolver, /* Use GError? */ NULL)) {
-        g_warning ("Failed to initiate the asyncns library");
+        g_log (LM_LOG_DOMAIN, LM_LOG_LEVEL_NET,
+               "Failed to initiate the asyncns library");
         /* FIXME: Signal error */
         return;
     }
--- a/loudmouth/lm-connection.c	Wed Feb 10 11:59:07 2010 +0100
+++ b/loudmouth/lm-connection.c	Wed Feb 17 23:53:20 2010 +0100
@@ -1679,7 +1679,8 @@
     g_return_if_fail (server != NULL);
 
     if (lm_connection_is_open (connection)) {
-        g_warning ("Can't change server address while connected");
+        g_log (LM_LOG_DOMAIN, LM_LOG_LEVEL_VERBOSE,
+               "Can't change server address while connected");
         return;
     }
 
@@ -1733,7 +1734,8 @@
     g_return_if_fail (connection != NULL);
 
     if (lm_connection_is_open (connection)) {
-        g_warning ("Can't change JID while connected");
+        g_log (LM_LOG_DOMAIN, LM_LOG_LEVEL_VERBOSE,
+                   "Can't change JID while connected");
         return;
     }
 
@@ -1770,7 +1772,8 @@
     g_return_if_fail (connection != NULL);
 
     if (lm_connection_is_open (connection)) {
-        g_warning ("Can't change server port while connected");
+        g_log (LM_LOG_DOMAIN, LM_LOG_LEVEL_VERBOSE,
+               "Can't change server port while connected");
         return;
     }
 
@@ -1847,7 +1850,8 @@
     g_return_if_fail (connection != NULL);
 
     if (lm_connection_is_open (connection)) {
-        g_warning ("Can't change server proxy while connected");
+        g_log (LM_LOG_DOMAIN, LM_LOG_LEVEL_VERBOSE,
+               "Can't change server proxy while connected");
         return;
     }
 
--- a/loudmouth/lm-sasl.c	Wed Feb 10 11:59:07 2010 +0100
+++ b/loudmouth/lm-sasl.c	Wed Feb 17 23:53:20 2010 +0100
@@ -370,7 +370,8 @@
     lm_message_unref (msg);
 
     if (!result) {
-        g_warning ("Failed to send SASL response\n");
+        g_log (LM_LOG_DOMAIN, LM_LOG_LEVEL_NET,
+               "Failed to send SASL response\n");
         return FALSE;
     }
 
@@ -689,7 +690,8 @@
     lm_message_unref (msg);
 
     if (!result) {
-        g_warning ("Failed to send SASL response\n");
+        g_log (LM_LOG_DOMAIN, LM_LOG_LEVEL_NET,
+               "Failed to send SASL response\n");
         return FALSE;
     }
 
@@ -787,7 +789,7 @@
         break;
 #endif
     default:
-        g_warning ("Wrong auth type");
+        g_log (LM_LOG_DOMAIN, LM_LOG_LEVEL_NET, "Wrong auth type");
         break;
     }
 
@@ -850,7 +852,7 @@
         break;
 #endif
     default:
-        g_warning ("Wrong auth type");
+        g_log (LM_LOG_DOMAIN, LM_LOG_LEVEL_NET, "Wrong auth type");
         break;
     }
 
--- a/loudmouth/lm-ssl-openssl.c	Wed Feb 10 11:59:07 2010 +0100
+++ b/loudmouth/lm-ssl-openssl.c	Wed Feb 17 23:53:20 2010 +0100
@@ -62,39 +62,39 @@
 
     switch (SSL_get_error(ssl->ssl, val)) {
     case SSL_ERROR_NONE:
-        g_warning ("%s(): %i / SSL_ERROR_NONE",
+        g_log (LM_LOG_DOMAIN, LM_LOG_LEVEL_SSL, "%s(): %i / SSL_ERROR_NONE",
                    func, val);
         break;
     case SSL_ERROR_ZERO_RETURN:
-        g_warning ("%s(): %i / SSL_ERROR_ZERO_RETURN",
-                   func, val);
+        g_log (LM_LOG_DOMAIN, LM_LOG_LEVEL_SSL,
+                   "%s(): %i / SSL_ERROR_ZERO_RETURN", func, val);
         break;
     case SSL_ERROR_WANT_READ:
-        g_warning ("%s(): %i / SSL_ERROR_WANT_READ",
-                   func, val);
+        g_log (LM_LOG_DOMAIN, LM_LOG_LEVEL_SSL,
+                   "%s(): %i / SSL_ERROR_WANT_READ", func, val);
         break;
     case SSL_ERROR_WANT_WRITE:
-        g_warning ("%s(): %i / SSL_ERROR_WANT_WRITE",
-                   func, val);
+        g_log (LM_LOG_DOMAIN, LM_LOG_LEVEL_SSL,
+                   "%s(): %i / SSL_ERROR_WANT_WRITE", func, val);
         break;
     case SSL_ERROR_WANT_X509_LOOKUP:
-        g_warning ("%s(): %i / SSL_ERROR_WANT_X509_LOOKUP",
-                   func, val);
+        g_log (LM_LOG_DOMAIN, LM_LOG_LEVEL_SSL,
+                   "%s(): %i / SSL_ERROR_WANT_X509_LOOKUP", func, val);
         break;
     case SSL_ERROR_SYSCALL:
-        g_warning ("%s(): %i / SSL_ERROR_SYSCALL",
-                   func, val);
+        g_log (LM_LOG_DOMAIN, LM_LOG_LEVEL_SSL,
+                   "%s(): %i / SSL_ERROR_SYSCALL", func, val);
         break;
     case SSL_ERROR_SSL:
-        g_warning ("%s(): %i / SSL_ERROR_SSL",
-                   func, val);
+        g_log (LM_LOG_DOMAIN, LM_LOG_LEVEL_SSL,
+                   "%s(): %i / SSL_ERROR_SSL", func, val);
         break;
     }
     do {
         errid = ERR_get_error();
         if (errid) {
             errmsg = ERR_error_string(errid, NULL);
-            g_warning ("\t%s", errmsg);
+            g_log (LM_LOG_DOMAIN, LM_LOG_LEVEL_SSL, "\t%s", errmsg);
         }
     } while (errid != 0);
 }
@@ -224,7 +224,8 @@
             }
         }
     } else {
-        g_warning ("X509_NAME_get_text_by_NID() failed");
+        g_log (LM_LOG_DOMAIN, LM_LOG_LEVEL_SSL,
+               "X509_NAME_get_text_by_NID() failed");
     }
 
     g_log (LM_LOG_DOMAIN, LM_LOG_LEVEL_SSL,
@@ -297,12 +298,13 @@
 
     ssl->ssl_method = TLSv1_client_method();
     if (ssl->ssl_method == NULL) {
-        g_warning ("TLSv1_client_method() == NULL");
+        g_log (LM_LOG_DOMAIN, LM_LOG_LEVEL_SSL,
+               "TLSv1_client_method() == NULL");
         abort();
     }
     ssl->ssl_ctx = SSL_CTX_new(ssl->ssl_method);
     if (ssl->ssl_ctx == NULL) {
-        g_warning ("SSL_CTX_new() == NULL");
+        g_log (LM_LOG_DOMAIN, LM_LOG_LEVEL_SSL, "SSL_CTX_new() == NULL");
         abort();
     }
 
@@ -340,14 +342,14 @@
 
     ssl->ssl = SSL_new(ssl->ssl_ctx);
     if (ssl->ssl == NULL) {
-        g_warning ("SSL_new() == NULL");
+        g_log (LM_LOG_DOMAIN, LM_LOG_LEVEL_SSL, "SSL_new() == NULL");
         g_set_error(error, LM_ERROR, LM_ERROR_CONNECTION_OPEN,
                     "SSL_new()");
         return FALSE;
     }
 
     if (!SSL_set_fd (ssl->ssl, fd)) {
-        g_warning ("SSL_set_fd() failed");
+        g_log (LM_LOG_DOMAIN, LM_LOG_LEVEL_SSL, "SSL_set_fd() failed");
         g_set_error(error, LM_ERROR, LM_ERROR_CONNECTION_OPEN,
                     "SSL_set_fd()");
         return FALSE;