aboutsummaryrefslogtreecommitdiff
path: root/src/zenutil
diff options
context:
space:
mode:
authorDan Engelbrecht <[email protected]>2025-08-26 14:05:15 +0200
committerGitHub Enterprise <[email protected]>2025-08-26 14:05:15 +0200
commit0cc32cae5e3fb832bbad584ce86a308dc6104c46 (patch)
tree33d81192d767864b5149aeece975b321ef04a00a /src/zenutil
parentimprove console output (#476) (diff)
downloadzen-0cc32cae5e3fb832bbad584ce86a308dc6104c46.tar.xz
zen-0cc32cae5e3fb832bbad584ce86a308dc6104c46.zip
rework `--quiet` zenserver option add `--noconsole` option (#477)
- Improvement: Changed zenserver `--quiet` option to suppress INFO level messages and below to surface startup and runtime errors - Feature: Added `--noconsole` option that suppresses all output to standard out, this works as the `--quiet` option used to work
Diffstat (limited to 'src/zenutil')
-rw-r--r--src/zenutil/include/zenutil/logging.h1
-rw-r--r--src/zenutil/logging.cpp4
2 files changed, 5 insertions, 0 deletions
diff --git a/src/zenutil/include/zenutil/logging.h b/src/zenutil/include/zenutil/logging.h
index d64eef207..85ddc86cd 100644
--- a/src/zenutil/include/zenutil/logging.h
+++ b/src/zenutil/include/zenutil/logging.h
@@ -34,6 +34,7 @@ struct LoggingOptions
bool IsTest = false;
bool AllowAsync = true;
bool NoConsoleOutput = false;
+ bool QuietConsole = false;
std::filesystem::path AbsLogFile; // Absolute path to main log file
std::string LogId;
};
diff --git a/src/zenutil/logging.cpp b/src/zenutil/logging.cpp
index cb0fd6679..8ff58ee73 100644
--- a/src/zenutil/logging.cpp
+++ b/src/zenutil/logging.cpp
@@ -121,6 +121,10 @@ BeginInitializeLogging(const LoggingOptions& LogOptions)
else
{
auto ConsoleSink = std::make_shared<spdlog::sinks::ansicolor_stdout_sink_mt>();
+ if (LogOptions.QuietConsole)
+ {
+ ConsoleSink->set_level(spdlog::level::warn);
+ }
Sinks.push_back(ConsoleSink);
}