libt2n: (gerd) fix & improve logging
[libt2n] / src / client.cpp
index 9c6e05b..2ce213b 100644 (file)
@@ -33,8 +33,10 @@ client_connection::client_connection()
 /// get pointer to logging stream, returns NULL if no logging needed
 std::ostream* client_connection::get_logstream(log_level_values level)
 {
-    if (logstream && level >= log_level)
+    if (logstream && log_level >= level)
         return logstream;
+    else
+        return NULL;
 }
 
 /// activate logging to the given stream. everything above the given level is logged.