X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=ltt%2Fbranches%2Fpoly%2Flttv%2Fmain%2Fmain.c;h=eb6625a548b94a7c47b10acfffd15691f7d4308b;hb=2a2fa4f0852b2a2701733c370059bad8aa000b03;hp=7b6f7153c39a6545c6226079ea07f616e82d0d12;hpb=fcdf74b2f0f101853545898193bcc2f6eb02c85d;p=lttv.git diff --git a/ltt/branches/poly/lttv/main/main.c b/ltt/branches/poly/lttv/main/main.c index 7b6f7153..eb6625a5 100644 --- a/ltt/branches/poly/lttv/main/main.c +++ b/ltt/branches/poly/lttv/main/main.c @@ -1,3 +1,21 @@ +/* This file is part of the Linux Trace Toolkit viewer + * Copyright (C) 2003-2004 Michel Dagenais + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License Version 2 as + * published by the Free Software Foundation; + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place - Suite 330, Boston, + * MA 02111-1307, USA. + */ + #include #include @@ -56,6 +74,14 @@ static void lttv_debug(void *hook_data); static void lttv_help(void *hook_data); +/* This is the handler to specify when we dont need all the debugging + messages. It receives the message and does nothing. */ + +void ignore_and_drop_message(const gchar *log_domain, GLogLevelFlags log_level, + const gchar *message, gpointer user_data) { +} + + /* Since everything is done in modules, the main program only takes care of the infrastructure. */ @@ -69,6 +95,9 @@ int main(int argc, char **argv) { g_mem_profile(); #endif + 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(); //g_type_init_with_debug_flags (G_TYPE_DEBUG_OBJECTS | G_TYPE_DEBUG_SIGNALS); @@ -104,7 +133,7 @@ int main(int argc, char **argv) { /* Initialize the module loading */ - lttv_module_path_add("/usr/lib/lttv/plugins"); + lttv_module_path_add(PACKAGE_PLUGIN_DIR); /* Add some built-in options */ @@ -170,6 +199,7 @@ void lttv_module_path_option(void *hook_data) lttv_module_path_add(a_module_path); } + void lttv_verbose(void *hook_data) { g_log_set_handler(NULL, G_LOG_LEVEL_INFO, g_log_default_handler, NULL);