]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/ngircd/log.c
Introduce_Client() => Client_Introduce(), and move it to client.c
[ngircd-alex.git] / src / ngircd / log.c
index 80b2c056001daeb518012a8ce59782ff8e619eac..6f0c4c9db1129d3a2cc291d6d3811fd297591ebb 100644 (file)
@@ -64,6 +64,12 @@ Log_Message(int Level, const char *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.
+ */
 GLOBAL void
 Log_Init(bool Daemon_Mode)
 {
@@ -73,11 +79,31 @@ Log_Init(bool Daemon_Mode)
 #ifndef LOG_CONS     /* Kludge: mips-dec-ultrix4.5 has no LOG_CONS */
 #define LOG_CONS 0
 #endif
-       openlog(PACKAGE_NAME, LOG_CONS|LOG_PID, Conf_SyslogFacility);
+#ifdef LOG_DAEMON
+       openlog(PACKAGE_NAME, LOG_CONS|LOG_PID, LOG_DAEMON);
+#else
+       openlog(PACKAGE_NAME, LOG_CONS|LOG_PID, 0);
+#endif
 #endif
+} /* Log_Init */
+
 
+/**
+ * Re-init logging after reading the configuration file.
+ */
+GLOBAL void
+Log_ReInit(void)
+{
+#ifdef SYSLOG
+#ifndef LOG_CONS     /* Kludge: mips-dec-ultrix4.5 has no LOG_CONS */
+#define LOG_CONS 0
+#endif
+       closelog();
+       openlog(PACKAGE_NAME, LOG_CONS|LOG_PID, Conf_SyslogFacility);
+#endif
        Log(LOG_NOTICE, "%s started.", NGIRCd_Version);
-} /* Log_Init */
+       Log(LOG_INFO, "Using configuration file \"%s\" ...", NGIRCd_ConfFile);
+}
 
 
 GLOBAL void