diff options
Diffstat (limited to 'src/core/main.c')
-rw-r--r-- | src/core/main.c | 26 |
1 files changed, 23 insertions, 3 deletions
diff --git a/src/core/main.c b/src/core/main.c index 7b3c95e3..95da1233 100644 --- a/src/core/main.c +++ b/src/core/main.c | |||
@@ -77,7 +77,10 @@ int main(int argc, | |||
77 | GtkWidget * root; | 77 | GtkWidget * root; |
78 | int i; | 78 | int i; |
79 | struct GE_Context * ectx; | 79 | struct GE_Context * ectx; |
80 | struct GE_Context * my_ctx; | ||
80 | struct GC_Configuration * cfg; | 81 | struct GC_Configuration * cfg; |
82 | char * log; | ||
83 | GE_KIND mask; | ||
81 | #if ENABLE_NLS | 84 | #if ENABLE_NLS |
82 | char * path; | 85 | char * path; |
83 | #endif | 86 | #endif |
@@ -116,6 +119,23 @@ int main(int argc, | |||
116 | initGNUnetGTKCommon(ectx, | 119 | initGNUnetGTKCommon(ectx, |
117 | cfg, | 120 | cfg, |
118 | &gnunet_gtk_main_quit); | 121 | &gnunet_gtk_main_quit); |
122 | /* configure GTK logging */ | ||
123 | GC_get_configuration_value_string(cfg, | ||
124 | "LOGGING", | ||
125 | "USER-LEVEL", | ||
126 | "WARNING", | ||
127 | &log); | ||
128 | mask = GE_getKIND(log); | ||
129 | FREE(log); | ||
130 | mask |= mask-1; /* set all bits... */ | ||
131 | mask |= GE_USER | GE_BULK | GE_IMMEDIATE; | ||
132 | if (YES == GC_get_configuration_value_yesno(cfg, | ||
133 | "LOGGING", | ||
134 | "DEVELOPER", | ||
135 | NO)) | ||
136 | mask |= GE_DEVELOPER | GE_REQUEST; | ||
137 | my_ctx = createGtkLogger(mask); | ||
138 | GE_setDefaultContext(my_ctx); | ||
119 | root | 139 | root |
120 | = glade_xml_get_widget(getMainXML(), | 140 | = glade_xml_get_widget(getMainXML(), |
121 | "mainWindow"); | 141 | "mainWindow"); |
@@ -124,9 +144,7 @@ int main(int argc, | |||
124 | initTrayIcon(); | 144 | initTrayIcon(); |
125 | #endif | 145 | #endif |
126 | gtk_widget_show(root); | 146 | gtk_widget_show(root); |
127 | #if 0 | 147 | |
128 | GE_setDefaultContext(customLog); | ||
129 | #endif | ||
130 | /* start the event loop */ | 148 | /* start the event loop */ |
131 | gdk_threads_enter(); | 149 | gdk_threads_enter(); |
132 | 150 | ||
@@ -136,6 +154,8 @@ int main(int argc, | |||
136 | 154 | ||
137 | gtk_main(); | 155 | gtk_main(); |
138 | gdk_threads_leave(); | 156 | gdk_threads_leave(); |
157 | GE_setDefaultContext(ectx); | ||
158 | GE_free_context(my_ctx); | ||
139 | doneGNUnetGTKCommon(); | 159 | doneGNUnetGTKCommon(); |
140 | GNUNET_fini(ectx, cfg); | 160 | GNUNET_fini(ectx, cfg); |
141 | return 0; | 161 | return 0; |