diff options
| author | 2023-01-09 14:36:23 +0000 | |
|---|---|---|
| committer | 2023-01-09 18:16:40 +0000 | |
| commit | 573296baea8fabe0bcaaa47d535613e6750b9b62 (patch) | |
| tree | 1731099d9b21ecfbd6ebf9010083383ea4ae2bc2 /src/logging.cpp | |
| parent | Rework how users are assigned to connect classes. (diff) | |
Fix enabling the raw I/O logging warning when <log:level> is rawio.
Diffstat (limited to 'src/logging.cpp')
| -rw-r--r-- | src/logging.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/logging.cpp b/src/logging.cpp index c1f030615..249dd86e1 100644 --- a/src/logging.cpp +++ b/src/logging.cpp @@ -175,6 +175,7 @@ void Log::Manager::EnableDebugMode() TokenList types = std::string("*"); MethodPtr method = stdoutlog.Create(ServerInstance->Config->EmptyTag); loggers.emplace_back(Level::RAWIO, std::move(types), std::move(method), false, &stdoutlog); + ServerInstance->Config->RawLog = true; } void Log::Manager::OpenLogs(bool requiremethods) @@ -183,7 +184,6 @@ void Log::Manager::OpenLogs(bool requiremethods) if (ServerInstance->Config->cmdline.forcedebug) { Normal("LOG", "Not opening loggers because we were started with --debug"); - ServerInstance->Config->RawLog = true; return; } @@ -243,6 +243,11 @@ 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; + }); } void Log::Manager::RegisterServices() |
