diff options
author | Attila Molnar <attilamolnar@hush.com> | 2013-05-21 17:11:46 -0700 |
---|---|---|
committer | Attila Molnar <attilamolnar@hush.com> | 2013-05-21 17:11:46 -0700 |
commit | b36ce84c7da93f680fc397bcb4c877abe063eaaa (patch) | |
tree | 4e5a593816383612d0e49bf6e4affa4f3d354dc8 /src/logger.cpp | |
parent | 4710844dcae83f54acd89d84a9c8dad607dfa17d (diff) | |
parent | 3e105c6311c23787ff54388c8d21c8ac1a01fd57 (diff) |
Merge pull request #545 from SaberUK/master+logging-cleanup
Clean up the logging system (part 1 of 2).
Diffstat (limited to 'src/logger.cpp')
-rw-r--r-- | src/logger.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/src/logger.cpp b/src/logger.cpp index 2b0b623f6..bbbb7eafa 100644 --- a/src/logger.cpp +++ b/src/logger.cpp @@ -21,7 +21,6 @@ #include "inspircd.h" - #include "filelogger.h" /* @@ -51,6 +50,10 @@ * */ +const char LogStream::LogHeader[] = + "Log started for " VERSION " (" REVISION ", " MODULE_INIT_STR ")" + " - compiled on " SYSTEM; + LogManager::LogManager() { Logging = false; @@ -82,7 +85,7 @@ void LogManager::OpenFileLogs() } std::string type = tag->getString("type"); std::string level = tag->getString("level"); - int loglevel = LOG_DEFAULT; + LogLevel loglevel = LOG_DEFAULT; if (level == "rawio") { loglevel = LOG_RAWIO; @@ -126,7 +129,7 @@ void LogManager::OpenFileLogs() fw = fwi->second; } FileLogStream* fls = new FileLogStream(loglevel, fw); - fls->OnLog(LOG_SPARSE, "HEADER", InspIRCd::LogHeader); + fls->OnLog(LOG_SPARSE, "HEADER", LogStream::LogHeader); AddLogTypes(type, fls, true); } } @@ -293,7 +296,7 @@ bool LogManager::DelLogType(const std::string &type, LogStream *l) return true; } -void LogManager::Log(const std::string &type, int loglevel, const char *fmt, ...) +void LogManager::Log(const std::string &type, LogLevel loglevel, const char *fmt, ...) { if (Logging) return; @@ -303,7 +306,7 @@ void LogManager::Log(const std::string &type, int loglevel, const char *fmt, ... this->Log(type, loglevel, buf); } -void LogManager::Log(const std::string &type, int loglevel, const std::string &msg) +void LogManager::Log(const std::string &type, LogLevel loglevel, const std::string &msg) { if (Logging) { |