Use g_info and g_debug properly.
[lttv.git] / ltt / branches / poly / lttv / main / main.c
index 6578c24d6b66aaeebfa19221a87c4a699711890e..eb6625a548b94a7c47b10acfffd15691f7d4308b 100644 (file)
@@ -74,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. */
 
@@ -87,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);
 
@@ -122,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 */
 
@@ -188,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);
This page took 0.024662 seconds and 4 git commands to generate.