diff options
| author | 2024-09-09 15:44:38 +0100 | |
|---|---|---|
| committer | 2024-09-09 15:48:02 +0100 | |
| commit | 6204c9636e8ea87d690e1e7c06cbf35d04083586 (patch) | |
| tree | 9d4e437bc9b5849fb85a716c6ddcea272b137822 /src/logging.cpp | |
| parent | Merge branch 'insp4' into master. (diff) | |
| parent | Send an ISupport diff when a user moves to a new connect class. (diff) | |
| download | inspircd++-6204c9636e8ea87d690e1e7c06cbf35d04083586.tar.gz inspircd++-6204c9636e8ea87d690e1e7c06cbf35d04083586.tar.bz2 inspircd++-6204c9636e8ea87d690e1e7c06cbf35d04083586.zip | |
Merge branch 'insp4' into master.
Diffstat (limited to 'src/logging.cpp')
| -rw-r--r-- | src/logging.cpp | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/src/logging.cpp b/src/logging.cpp index 7f772aefb..daf6100f1 100644 --- a/src/logging.cpp +++ b/src/logging.cpp @@ -224,6 +224,7 @@ void Log::Manager::OpenLogs(bool requiremethods) { const auto* option = ServerInstance->Config->CommandLine.forceprotodebug ? "--protocoldebug" : "--debug"; Normal("LOG", "Not opening loggers because we were started with {}", option); + CheckRawLog(); return; } @@ -231,6 +232,7 @@ void Log::Manager::OpenLogs(bool requiremethods) if (!ServerInstance->Config->CommandLine.writelog) { Normal("LOG", "Not opening loggers because we were started with --nolog"); + CheckRawLog(); return; } @@ -289,11 +291,7 @@ void Log::Manager::OpenLogs(bool requiremethods) cache.shrink_to_fit(); caching = false; } - - // There might be a logger not from the config so we need to check this outside of the creation loop. - ServerInstance->Config->RawLog = std::any_of(loggers.begin(), loggers.end(), [](const auto& logger) { - return logger.level >= Level::RAWIO; - }); + CheckRawLog(); } void Log::Manager::RegisterServices() @@ -312,6 +310,14 @@ void Log::Manager::UnloadEngine(const Engine* engine) Normal("LOG", "The {} log engine is unloading; removed {}/{} loggers.", engine->name.c_str(), logger_count - loggers.size(), logger_count); } +void Log::Manager::CheckRawLog() +{ + // There might be a logger not from the config so we need to check this outside of the creation loop. + ServerInstance->Config->RawLog = std::any_of(loggers.begin(), loggers.end(), [](const auto& logger) { + return logger.level >= Level::RAWIO; + }); +} + void Log::Manager::Write(Level level, const std::string& type, const std::string& message) { if (logging) |
