X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=ltt%2Fbranches%2Fpoly%2Flttv%2Flttv%2Fmain.c;h=f984df1414c656f26557059adc4487081c1a64dd;hb=58c88a41c3beff0c4c6ff7d856ab2355820d9f16;hp=c1b2324226054f781fa661b44d97143480ff1ba5;hpb=a43d67bae425508678e5ae2ffe5dd1e84286b915;p=lttv.git diff --git a/ltt/branches/poly/lttv/lttv/main.c b/ltt/branches/poly/lttv/lttv/main.c index c1b23242..f984df14 100644 --- a/ltt/branches/poly/lttv/lttv/main.c +++ b/ltt/branches/poly/lttv/lttv/main.c @@ -46,7 +46,8 @@ static char static gboolean a_verbose, - a_debug; + a_debug, + a_fatal; gboolean lttv_profile_memory; @@ -62,6 +63,8 @@ static void lttv_verbose(void *hook_data); static void lttv_debug(void *hook_data); +static void lttv_fatal(void *hook_data); + static void lttv_help(void *hook_data); /* This is the handler to specify when we dont need all the debugging @@ -108,9 +111,9 @@ int main(int argc, char **argv) { /* Initialize glib and by default ignore info and debug messages */ g_type_init(); - g_type_init_with_debug_flags (G_TYPE_DEBUG_OBJECTS | G_TYPE_DEBUG_SIGNALS); - //g_log_set_handler(NULL, G_LOG_LEVEL_INFO, ignore_and_drop_message, NULL); - //g_log_set_handler(NULL, G_LOG_LEVEL_DEBUG, ignore_and_drop_message, NULL); + //g_type_init_with_debug_flags (G_TYPE_DEBUG_OBJECTS | G_TYPE_DEBUG_SIGNALS); + g_log_set_handler(NULL, G_LOG_LEVEL_INFO, ignore_and_drop_message, NULL); + g_log_set_handler(NULL, G_LOG_LEVEL_DEBUG, ignore_and_drop_message, NULL); /* Have an attributes subtree to store hooks to be registered by modules. */ @@ -173,6 +176,11 @@ int main(int argc, char **argv) { a_debug = FALSE; lttv_option_add("debug",'d', "print debugging messages", "none", LTTV_OPT_NONE, NULL, lttv_debug, NULL); + + a_fatal = FALSE; + lttv_option_add("fatal",'f', "make critical messages fatal", + "none", + LTTV_OPT_NONE, NULL, lttv_fatal, NULL); lttv_profile_memory = FALSE; lttv_option_add(profile_memory_long_option + 2, @@ -251,6 +259,13 @@ void lttv_debug(void *hook_data) g_info("Logging set to include DEBUG level messages"); } +void lttv_fatal(void *hook_data) +{ + //g_log_set_always_fatal(G_LOG_LEVEL_WARNING | G_LOG_LEVEL_CRITICAL); + g_log_set_always_fatal(G_LOG_LEVEL_CRITICAL); + g_info("Critical log from glib will abort execution"); +} + void lttv_help(void *hook_data) { printf("Linux Trace Toolkit Visualizer\n");