X-Git-Url: http://www.privoxy.org/gitweb/?p=privoxy.git;a=blobdiff_plain;f=errlog.c;h=fe2ee38d0c287b174d993716c8176d3d23ffa7bf;hp=e094ddd5c76df0509d64c3f847168bed833bee08;hb=4877176b79cd08a203f3c8375418f20bdd14573d;hpb=e8e21b31e37d9d34f24a5d4e5024d0583d835b4e diff --git a/errlog.c b/errlog.c index e094ddd5..fe2ee38d 100644 --- a/errlog.c +++ b/errlog.c @@ -1,4 +1,4 @@ -const char errlog_rcs[] = "$Id: errlog.c,v 1.114 2012/03/09 17:55:50 fabiankeil Exp $"; +const char errlog_rcs[] = "$Id: errlog.c,v 1.117 2012/12/09 12:28:14 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/errlog.c,v $ @@ -146,25 +146,27 @@ static inline void unlock_loginit() {} *********************************************************************/ static void fatal_error(const char *error_message) { -#if defined(_WIN32) && !defined(_WIN_CONSOLE) - /* Skip timestamp and thread id for the message box. */ - const char *box_message = strstr(error_message, "Fatal error"); - if (NULL == box_message) + if (logfp != NULL) { - /* Shouldn't happen but ... */ - box_message = error_message; + fputs(error_message, logfp); } - MessageBox(g_hwndLogFrame, box_message, "Privoxy Error", - MB_OK | MB_ICONERROR | MB_TASKMODAL | MB_SETFOREGROUND | MB_TOPMOST); - /* Cleanup - remove taskbar icon etc. */ - TermLogWindow(); -#endif /* defined(_WIN32) && !defined(_WIN_CONSOLE) */ - - if (logfp != NULL) +#if defined(_WIN32) && !defined(_WIN_CONSOLE) { - fputs(error_message, logfp); + /* Skip timestamp and thread id for the message box. */ + const char *box_message = strstr(error_message, "Fatal error"); + if (NULL == box_message) + { + /* Shouldn't happen but ... */ + box_message = error_message; + } + MessageBox(g_hwndLogFrame, box_message, "Privoxy Error", + MB_OK | MB_ICONERROR | MB_TASKMODAL | MB_SETFOREGROUND | MB_TOPMOST); + + /* Cleanup - remove taskbar icon etc. */ + TermLogWindow(); } +#endif /* defined(_WIN32) && !defined(_WIN_CONSOLE) */ #if defined(unix) if (pidfile) @@ -621,6 +623,9 @@ static inline const char *get_log_level_string(int loglevel) case LOG_LEVEL_CGI: log_level_string = "CGI"; break; + case LOG_LEVEL_ACTIONS: + log_level_string = "Actions"; + break; default: log_level_string = "Unknown log level"; break; @@ -631,6 +636,7 @@ static inline const char *get_log_level_string(int loglevel) } +#define LOG_BUFFER_SIZE BUFFER_SIZE /********************************************************************* * * Function : log_error @@ -650,7 +656,7 @@ void log_error(int loglevel, const char *fmt, ...) va_list ap; char *outbuf = NULL; static char *outbuf_save = NULL; - char tempbuf[BUFFER_SIZE]; + char tempbuf[LOG_BUFFER_SIZE]; size_t length = 0; const char * src = fmt; long thread_id; @@ -660,7 +666,7 @@ void log_error(int loglevel, const char *fmt, ...) * why else do we allocate instead of using * an array? */ - size_t log_buffer_size = BUFFER_SIZE; + size_t log_buffer_size = LOG_BUFFER_SIZE; #if defined(_WIN32) && !defined(_WIN_CONSOLE) /*