wslua: Fix logging
authorPeter Wu <peter@lekensteyn.nl>
Fri, 23 Mar 2018 16:04:50 +0000 (17:04 +0100)
committerAnders Broman <a.broman58@gmail.com>
Sat, 24 Mar 2018 07:17:03 +0000 (07:17 +0000)
Always display Lua messages (to match tshark), do not send them to
qDebug as they will not be visible with the default log options.

Change-Id: I660a3877355891d45881b26735596ea6dc8a8b29
Fixes: v2.5.0rc0-2037-gc9b6887d84 ("wslua: Fix logger after g6a5e90f2")
Reviewed-on: https://code.wireshark.org/review/26599
Petri-Dish: Peter Wu <peter@lekensteyn.nl>
Tested-by: Petri Dish Buildbot
Reviewed-by: Anders Broman <a.broman58@gmail.com>
epan/wslua/wslua_util.c
ui/qt/funnel_statistics.cpp

index a16613a61e546dc30c9a3539d67962a7d87b33ea..ec3ee45d9a0c255fccbf478cad658aab4c120f2a 100644 (file)
@@ -149,8 +149,9 @@ static int wslua_log(lua_State* L, GLogLevelFlags log_level) {
 
         lua_pop(L, 1);  /* pop result */
     }
+    g_string_append_c(str, '\n');
 
-    wslua_logger(LOG_DOMAIN_LUA, log_level, "%s\n", str->str);
+    wslua_logger(LOG_DOMAIN_LUA, log_level, str->str, NULL);
     g_string_free(str,TRUE);
 
     return 0;
index ea508edb72532b5538049e2f85b49f8a9c05b141..3cf271a046eb646559796c912231edec11beb3f6 100644 (file)
@@ -196,7 +196,7 @@ void funnel_statistics_logger(const gchar *,
                           GLogLevelFlags,
                           const gchar *message,
                           gpointer) {
-    qDebug() << message;
+    fputs(message, stderr);
 }
 
 void funnel_statistics_retap_packets(funnel_ops_id_t *ops_id) {