aboutsummaryrefslogtreecommitdiff
path: root/src/logging.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/logging.cpp')
-rw-r--r--src/logging.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/logging.cpp b/src/logging.cpp
index da77af131..665939f9b 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;
}
@@ -295,11 +297,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()
@@ -318,6 +316,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)