X-Git-Url: http://www.privoxy.org/gitweb/?a=blobdiff_plain;f=errlog.c;h=96de4e181490a9332129a2062b3f45dd6a6fa01b;hb=249ba07cbd558908f4a012931c8bc4814c2186d1;hp=49caf8ab79a8b948ea52849f3fd6c649287f3807;hpb=406e2e875693726ea9e116ca68d87546b6496732;p=privoxy.git diff --git a/errlog.c b/errlog.c index 49caf8ab..96de4e18 100644 --- a/errlog.c +++ b/errlog.c @@ -1,4 +1,4 @@ -const char errlog_rcs[] = "$Id: errlog.c,v 1.55 2007/10/14 14:12:41 fabiankeil Exp $"; +const char errlog_rcs[] = "$Id: errlog.c,v 1.57 2007/10/27 13:02:26 fabiankeil Exp $"; /********************************************************************* * * File : $Source: /cvsroot/ijbswa/current/errlog.c,v $ @@ -33,6 +33,13 @@ const char errlog_rcs[] = "$Id: errlog.c,v 1.55 2007/10/14 14:12:41 fabiankeil E * * Revisions : * $Log: errlog.c,v $ + * Revision 1.57 2007/10/27 13:02:26 fabiankeil + * Relocate daemon-mode-related log messages to make sure + * they aren't shown again in case of configuration reloads. + * + * Revision 1.56 2007/10/14 14:26:56 fabiankeil + * Remove the old log_error() version. + * * Revision 1.55 2007/10/14 14:12:41 fabiankeil * When in daemon mode, close stderr after the configuration file has been * parsed the first time. If logfile isn't set, stop logging. Fixes BR#897436. @@ -511,9 +518,10 @@ void disable_logging(void) lock_logfile(); if (logfp != NULL) { + log_error(LOG_LEVEL_INFO, "No logfile configured. Logging disabled."); fclose(logfp); + logfp = NULL; } - logfp = NULL; unlock_logfile(); } @@ -543,7 +551,12 @@ void init_error_log(const char *prog_name, const char *logfname) lock_loginit(); lock_logfile(); - if ((logfp != NULL) && (logfp != stderr)) + if (logfp == stderr) + { + log_error(LOG_LEVEL_INFO, + "Switching to daemon mode. Log messages will be written to: %s", logfname); + } + else if (logfp != NULL) { log_error(LOG_LEVEL_INFO, "(Re-)Open logfile \'%s\'", logfname ? logfname : "none"); }