diff options
author | Orgad Shaneh <orgads@gmail.com> | 2017-10-30 15:42:43 +0200 |
---|---|---|
committer | Richard Sharpe <realrichardsharpe@gmail.com> | 2017-11-07 13:51:38 +0000 |
commit | dc0e6ccc9f9aaad7139c1edd3b723c4b939b15da (patch) | |
tree | b48fdb68a21e404cd42ace623f9635b54b45a5f8 /tfshark.c | |
parent | 5dd6a9cef95daf6ccee5007d766f10864f7dcc34 (diff) |
tshark/tfshark: Do not apply console.log.level before it is set
The user has no way to apply this setting while loading dissectors in order
to enable g_debug messages during init for example.
Change the behavior to be as documented in the comment.
Change-Id: I9317f12b207d4621508212b02ca1ebd46b55aadc
Reviewed-on: https://code.wireshark.org/review/24184
Petri-Dish: Roland Knall <rknall@gmail.com>
Tested-by: Petri Dish Buildbot
Reviewed-by: Richard Sharpe <realrichardsharpe@gmail.com>
Diffstat (limited to 'tfshark.c')
-rw-r--r-- | tfshark.c | 7 |
1 files changed, 3 insertions, 4 deletions
@@ -157,6 +157,7 @@ static void failure_message_cont(const char *msg_format, va_list ap); capture_file cfile; static GHashTable *output_only_tables = NULL; +static e_prefs *prefs_p = NULL; #if 0 struct string_elem { @@ -276,7 +277,7 @@ tfshark_log_handler (const gchar *log_domain, GLogLevelFlags log_level, { /* ignore log message, if log_level isn't interesting based upon the console log preferences. - If the preferences haven't been loaded loaded yet, display the + If the preferences haven't been loaded yet, display the message anyway. The default console_log_level preference value is such that only @@ -287,8 +288,7 @@ tfshark_log_handler (const gchar *log_domain, GLogLevelFlags log_level, ERROR and CRITICAL level messages so the current code is a behavioral change. The current behavior is the same as in Wireshark. */ - if ((log_level & G_LOG_LEVEL_MASK & prefs.console_log_level) == 0 && - prefs.console_log_level != 0) { + if (prefs_p && (log_level & G_LOG_LEVEL_MASK & prefs.console_log_level) == 0) { return; } @@ -345,7 +345,6 @@ main(int argc, char *argv[]) dfilter_t *rfcode = NULL; dfilter_t *dfcode = NULL; gchar *err_msg; - e_prefs *prefs_p; int log_flags; gchar *output_only = NULL; |