mirror of
https://github.com/inspircd/inspircd.git
synced 2025-03-09 10:39:02 -04:00
Fix rawio logs not being written after a rehash.
This commit is contained in:
parent
a3668d75d6
commit
b5032fb641
@ -236,6 +236,9 @@ private:
|
||||
/** Whether we are currently logging to a file. */
|
||||
bool logging = false;
|
||||
|
||||
/** Check whether raw logging is enabled. */
|
||||
void CheckRawLog();
|
||||
|
||||
/** Writes a message to the server log.
|
||||
* @param level The level to log at.
|
||||
* @param type The type of message that is being logged.
|
||||
|
@ -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)
|
||||
|
Loading…
x
Reference in New Issue
Block a user