To avoid this, the log handler in the error case:
- opens a console window (regardless of the users settings)
- waits for a keypress before continuing to terminate the program
This way, the user will be notified that there's a problem, instead of simply seeing a terminating program only.
svn path=/trunk/; revision=17236
today = localtime(&curr);
#ifdef _WIN32
- if (prefs.gui_console_open != console_open_never) {
+ if (prefs.gui_console_open != console_open_never || log_level & G_LOG_LEVEL_ERROR) {
+ /* the user wants a console or the application will terminate immediately */
create_console();
}
if (has_console) {
log_domain != NULL ? log_domain : "",
level, message);
#ifdef _WIN32
+ if(log_level & G_LOG_LEVEL_ERROR) {
+ /* wait for a key press before the following error handler will terminate the program
+ this way the user at least can read the error message */
+ printf("\n\nPress any key to exit\n");
+ _getch();
+ }
} else {
g_log_default_handler(log_domain, log_level, message, user_data);
}