aboutsummaryrefslogtreecommitdiffstats
path: root/src/configreader.cpp
diff options
context:
space:
mode:
authorGravatar Sadie Powell2026-06-19 13:00:58 +0100
committerGravatar Sadie Powell2026-06-19 15:35:38 +0100
commita2981a9e35ab987a621d8ac8bb1b85e424939c48 (patch)
treefad52f8e5df5c84fcf7129ad9a7269f53c5fe489 /src/configreader.cpp
parentMerge branch 'insp4' into master. (diff)
Rework error reporting and shutting down.
- Clean up InspIRCd::Cleanup and document it better. - Bring back QuickExit for error reporting during shutdown. - Deduplicate logging of error messages to stdout and files.
Diffstat (limited to 'src/configreader.cpp')
-rw-r--r--src/configreader.cpp18
1 files changed, 6 insertions, 12 deletions
diff --git a/src/configreader.cpp b/src/configreader.cpp
index 6cbae482f..efa67f978 100644
--- a/src/configreader.cpp
+++ b/src/configreader.cpp
@@ -498,8 +498,10 @@ void ServerConfig::Apply(const std::unique_ptr<ServerConfig>& old, const std::st
auto binds = ConfTags("bind");
if (binds.empty())
{
- errors.push_back("Possible configuration error: you have not defined any <bind> blocks.");
- errors.push_back("You will need to do this if you want clients to be able to connect!");
+ errors.push_back(
+ "You have not defined any <bind> blocks. You will need to do this "
+ "if you want clients to be able to connect!"
+ );
}
if (old && valid)
@@ -532,21 +534,16 @@ void ServerConfig::Apply(const std::unique_ptr<ServerConfig>& old, const std::st
else
fmt::print("{} ", fmt::styled("Error!", fmt::emphasis::bold | fmt::fg(fmt::terminal_color::red)));
- fmt::println("There are problems with your configuration file:", fmt::styled("Error!", fmt::emphasis::bold | fmt::fg(fmt::terminal_color::red)));
- fmt::println("");
+ fmt::println("There are problems with your configuration file:");
}
}
- auto message_shown = false;
auto* user = ServerInstance->Users.FindUUID(useruid);
for (const auto& line : errors)
{
// On startup, print out to console (still attached at this point)
if (!old)
- {
- message_shown = true;
- fmt::println("{}", line);
- }
+ fmt::println(" * {}", line);
// If a user is rehashing, tell them directly
if (user)
@@ -556,9 +553,6 @@ void ServerConfig::Apply(const std::unique_ptr<ServerConfig>& old, const std::st
ServerInstance->SNO.WriteGlobalSno('r', line);
}
- if (message_shown)
- fmt::println("");
-
errors.clear();
errors.shrink_to_fit();