From d8b4414ee18be69eb7c6c491587e4895dc995fac Mon Sep 17 00:00:00 2001 From: Sadie Powell Date: Sun, 18 Dec 2022 13:43:33 +0000 Subject: Rework the levels things are logged at to make more sense. --- src/configreader.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) (limited to 'src/configreader.cpp') diff --git a/src/configreader.cpp b/src/configreader.cpp index 053e990dc..fc2fcb131 100644 --- a/src/configreader.cpp +++ b/src/configreader.cpp @@ -563,7 +563,7 @@ std::shared_ptr ServerConfig::ConfValue(const std::string& tag, std:: if (tags.count() > 1) { - ServerInstance->Logs.Normal("CONFIG", "Multiple (%zu) <%s> tags found; only the first will be used (first at %s, last at %s)", + ServerInstance->Logs.Warning("CONFIG", "Multiple (%zu) <%s> tags found; only the first will be used (first at %s, last at %s)", tags.count(), tag.c_str(), tags.begin()->second->source.str().c_str(), std::prev(tags.end())->second->source.str().c_str()); } return tags.begin()->second; @@ -608,7 +608,7 @@ std::vector ServerConfig::GetModules() const const std::string shortname = ModuleManager::ShrinkModName(tag->getString("name")); if (shortname.empty()) { - ServerInstance->Logs.Normal("CONFIG", "Malformed tag at " + tag->source.str() + "; skipping ..."); + ServerInstance->Logs.Warning("CONFIG", "Malformed tag at " + tag->source.str() + "; skipping ..."); continue; } @@ -644,7 +644,7 @@ void ConfigReaderThread::OnStart() void ConfigReaderThread::OnStop() { ServerConfig* old = ServerInstance->Config; - ServerInstance->Logs.Debug("CONFIG", "Switching to new configuration..."); + ServerInstance->Logs.Normal("CONFIG", "Switching to new configuration..."); ServerInstance->Config = this->Config; Config->Apply(old, UUID); @@ -670,7 +670,8 @@ void ConfigReaderThread::OnStop() } catch (const CoreException& modex) { - ServerInstance->Logs.Normal("MODULE", "Exception caught: " + modex.GetReason()); + ServerInstance->Logs.Error("MODULE", "Unable to read the configuration for %s: %s", + mod->ModuleSourceFile.c_str(), modex.what()); if (user) user->WriteNotice(modname + ": " + modex.GetReason()); } @@ -686,7 +687,7 @@ void ConfigReaderThread::OnStop() } catch (const CoreException& ex) { - ServerInstance->Logs.Normal("LOG", "Cannot open log files: " + ex.GetReason()); + ServerInstance->Logs.Error("LOG", "Cannot open log files: " + ex.GetReason()); if (user) user->WriteNotice("Cannot open log files: " + ex.GetReason()); } -- cgit v1.3.1-10-gc9f91