aboutsummaryrefslogtreecommitdiffstats
path: root/epan/prefs.c
diff options
context:
space:
mode:
authorulfl <ulfl@f5534014-38df-0310-8fa8-9805f1628bb7>2005-10-12 21:26:27 +0000
committerulfl <ulfl@f5534014-38df-0310-8fa8-9805f1628bb7>2005-10-12 21:26:27 +0000
commita5b56a104aed6d939e30b8ada0957ef11c89c75b (patch)
tree65514efdadc5e78ba2b5e9c38383f51eeae56d59 /epan/prefs.c
parent8782f4e3aa70eec86963d49eaadd38240abf7c1a (diff)
from Richard van der Hoff:
Attached is a patch which makes the console log level (warning/message/debug etc) a configurable preference. There's no gui for setting it, but since it's pretty much only going to be useful for developers, I'm sure you'll cope... ---- I've added a small comment to the file output that it has no dialog output git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@16205 f5534014-38df-0310-8fa8-9805f1628bb7
Diffstat (limited to 'epan/prefs.c')
-rw-r--r--epan/prefs.c21
1 files changed, 20 insertions, 1 deletions
diff --git a/epan/prefs.c b/epan/prefs.c
index 71ee3d0410..09151b04a3 100644
--- a/epan/prefs.c
+++ b/epan/prefs.c
@@ -1034,6 +1034,8 @@ init_prefs(void) {
prefs.gui_layout_content_1 = layout_pane_content_plist;
prefs.gui_layout_content_2 = layout_pane_content_pdetails;
prefs.gui_layout_content_3 = layout_pane_content_pbytes;
+ prefs.console_log_level =
+ G_LOG_LEVEL_WARNING | G_LOG_LEVEL_CRITICAL | G_LOG_LEVEL_ERROR;
/* set the default values for the capture dialog box */
prefs.capture_device = NULL;
@@ -1388,6 +1390,7 @@ prefs_set_pref(char *prefarg)
#define PRS_GUI_LAYOUT_CONTENT_1 "gui.layout_content_1"
#define PRS_GUI_LAYOUT_CONTENT_2 "gui.layout_content_2"
#define PRS_GUI_LAYOUT_CONTENT_3 "gui.layout_content_3"
+#define PRS_CONSOLE_LOG_LEVEL "console.log.level"
/*
* This applies to more than just captures, so it's not "capture.name_resolve";
@@ -1740,7 +1743,9 @@ set_pref(gchar *pref_name, gchar *value)
} else if (strcmp(pref_name, PRS_GUI_LAYOUT_CONTENT_3) == 0) {
prefs.gui_layout_content_3 =
find_index_from_string_array(value, gui_layout_content_text, 0);
-
+ } else if (strcmp(pref_name, PRS_CONSOLE_LOG_LEVEL) == 0) {
+ prefs.console_log_level = strtoul(value, NULL, 10);
+
/* handle the capture options */
} else if (strcmp(pref_name, PRS_CAP_DEVICE) == 0) {
if (prefs.capture_device != NULL)
@@ -2422,6 +2427,19 @@ write_prefs(char **pf_path_return)
(prefs.st_server_bg.green * 255 / 65535),
(prefs.st_server_bg.blue * 255 / 65535));
+ fprintf(pf, "\n######## Console: logging level ########\n");
+ fprintf(pf, "# (debugging only, not in the Preferences dialog)\n");
+ fprintf(pf, "# A bitmask of glib log levels:\n"
+ "# G_LOG_LEVEL_ERROR = 4\n"
+ "# G_LOG_LEVEL_CRITICAL = 8\n"
+ "# G_LOG_LEVEL_WARNING = 16\n"
+ "# G_LOG_LEVEL_MESSAGE = 32\n"
+ "# G_LOG_LEVEL_INFO = 64\n"
+ "# G_LOG_LEVEL_DEBUG = 128\n");
+
+ fprintf(pf, PRS_CONSOLE_LOG_LEVEL ": %u\n",
+ prefs.console_log_level);
+
fprintf(pf, "\n####### Capture ########\n");
if (prefs.capture_device != NULL) {
@@ -2554,6 +2572,7 @@ copy_prefs(e_prefs *dest, e_prefs *src)
dest->gui_geometry_save_maximized = src->gui_geometry_save_maximized;
dest->gui_webbrowser = g_strdup(src->gui_webbrowser);
dest->gui_window_title = g_strdup(src->gui_window_title);
+ dest->console_log_level = src->console_log_level;
/* values for the capture dialog box */
dest->capture_device = g_strdup(src->capture_device);
dest->capture_devices_descr = g_strdup(src->capture_devices_descr);