/*
* ngIRCd -- The Next Generation IRC Daemon
- * Copyright (c)2001-2012 Alexander Barton (alex@barton.de)
+ * Copyright (c)2001-2019 Alexander Barton (alex@barton.de) and Contributors.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
#include "log.h"
-static bool Is_Daemon;
+static bool Use_Syslog;
static void
Log_Message(int Level, const char *msg)
{
- if (!Is_Daemon) {
+ if (!Use_Syslog) {
/* log to console */
fprintf(stdout, "[%ld:%d %4ld] %s\n", (long)getpid(), Level,
(long)(time(NULL) - NGIRCd_Start), msg);
* Initialitze logging.
* This function is called before the configuration file is read in.
*
- * @param Daemon_Mode Set to true if ngIRCd is running as daemon.
+ * @param Syslog_Mode Set to true if ngIRCd is running as daemon.
*/
GLOBAL void
-Log_Init(bool Daemon_Mode)
+Log_Init(bool Syslog_Mode)
{
- Is_Daemon = Daemon_Mode;
+ Use_Syslog = Syslog_Mode;
#ifdef SYSLOG
#ifndef LOG_CONS /* Kludge: mips-dec-ultrix4.5 has no LOG_CONS */
openlog(PACKAGE, LOG_CONS|LOG_PID, 0);
#endif
#endif
+ Log(LOG_NOTICE, "%s starting ...", NGIRCd_Version);
} /* Log_Init */
closelog();
openlog(PACKAGE, LOG_CONS|LOG_PID, Conf_SyslogFacility);
#endif
- Log(LOG_NOTICE, "%s started.", NGIRCd_Version);
- Log(LOG_INFO, "Using configuration file \"%s\" ...", NGIRCd_ConfFile);
}
GLOBAL void
Log_Exit( void )
{
- Log(LOG_INFO, "%s done%s, served %lu connection%s.", PACKAGE_NAME,
+ Log(LOG_NOTICE, "%s done%s, served %lu connection%s.", PACKAGE_NAME,
NGIRCd_SignalRestart ? " (restarting)" : "", Conn_CountAccepted(),
Conn_CountAccepted() == 1 ? "" : "s");
#ifdef SYSLOG