diff options
author | Ulf Lamping <ulf.lamping@web.de> | 2005-05-26 17:50:27 +0000 |
---|---|---|
committer | Ulf Lamping <ulf.lamping@web.de> | 2005-05-26 17:50:27 +0000 |
commit | 5d404864f204147ede0cb6e19c64e06ebdb85496 (patch) | |
tree | 91a8bae1bf7b20b378e960da7c100cb4475479ef /capture.c | |
parent | 4a5deae5759f85eba4592689aec83ce380959af6 (diff) | |
download | wireshark-5d404864f204147ede0cb6e19c64e06ebdb85496.tar.gz wireshark-5d404864f204147ede0cb6e19c64e06ebdb85496.tar.bz2 wireshark-5d404864f204147ede0cb6e19c64e06ebdb85496.zip |
use the log features of the GLib to have verbose output of the capturing engine, e.g. GLib provides different domains for different submodules. Output more verbose than warning level will be disabled by default (just like before).
use the console_log_handler in main.c for win32 AND unix now
Currently use the log for the capturing engine (only), as I desperately needed a log output for debugging.
svn path=/trunk/; revision=14438
Diffstat (limited to 'capture.c')
-rw-r--r-- | capture.c | 16 |
1 files changed, 15 insertions, 1 deletions
@@ -69,6 +69,7 @@ #include "capture-wpcap.h" #endif #include "ui_util.h" +#include "log.h" @@ -89,6 +90,8 @@ capture_start(capture_options *capture_opts) g_assert(capture_opts->state == CAPTURE_STOPPED); capture_opts->state = CAPTURE_PREPARING; + g_log(LOG_DOMAIN_CAPTURE, G_LOG_LEVEL_MESSAGE, "Capture Start ..."); + /* try to start the capture child process */ ret = sync_pipe_start(capture_opts); if(!ret) { @@ -114,6 +117,8 @@ capture_start(capture_options *capture_opts) void capture_stop(capture_options *capture_opts) { + g_log(LOG_DOMAIN_CAPTURE, G_LOG_LEVEL_MESSAGE, "Capture Stop ..."); + /* stop the capture child gracefully */ sync_pipe_stop(capture_opts); } @@ -122,6 +127,8 @@ capture_stop(capture_options *capture_opts) void capture_restart(capture_options *capture_opts) { + g_log(LOG_DOMAIN_CAPTURE, G_LOG_LEVEL_MESSAGE, "Capture Restart"); + capture_opts->restart = TRUE; capture_stop(capture_opts); } @@ -130,6 +137,8 @@ capture_restart(capture_options *capture_opts) void capture_kill_child(capture_options *capture_opts) { + g_log(LOG_DOMAIN_CAPTURE, G_LOG_LEVEL_MESSAGE, "Capture Kill"); + /* kill the capture child */ sync_pipe_kill(capture_opts); } @@ -225,8 +234,12 @@ capture_input_new_file(capture_options *capture_opts, gchar *new_file) int err; + if(capture_opts->state == CAPTURE_PREPARING) { + g_log(LOG_DOMAIN_CAPTURE, G_LOG_LEVEL_MESSAGE, "Capture started!"); + } + g_log(LOG_DOMAIN_CAPTURE, G_LOG_LEVEL_MESSAGE, "File: \"%s\"", new_file); + g_assert(capture_opts->state == CAPTURE_PREPARING || capture_opts->state == CAPTURE_RUNNING); - /*g_warning("New capture file: %s", new_file);*/ /* free the old filename */ if(capture_opts->save_file != NULL) { @@ -317,6 +330,7 @@ capture_input_closed(capture_options *capture_opts) int err; + g_log(LOG_DOMAIN_CAPTURE, G_LOG_LEVEL_MESSAGE, "Capture stopped!"); g_assert(capture_opts->state == CAPTURE_PREPARING || capture_opts->state == CAPTURE_RUNNING); /* if we didn't started the capture (happens if an error occured), do a fake start */ |