diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/buildtool/common/cli.hpp | 4 | ||||
-rw-r--r-- | src/buildtool/main/main.cpp | 1 |
2 files changed, 5 insertions, 0 deletions
diff --git a/src/buildtool/common/cli.hpp b/src/buildtool/common/cli.hpp index 46af6598..f0875aaa 100644 --- a/src/buildtool/common/cli.hpp +++ b/src/buildtool/common/cli.hpp @@ -30,6 +30,7 @@ struct CommonArguments { struct LogArguments { std::optional<std::filesystem::path> log_file{}; LogLevel log_limit{kDefaultLogLevel}; + bool plain_log{false}; }; /// \brief Arguments required for analysing targets. @@ -148,6 +149,9 @@ static inline auto SetupLogArguments( kLastLogLevel, kDefaultLogLevel)) ->type_name("NUM"); + app->add_flag("--plain-log", + clargs->plain_log, + "Do not use ANSI escape sequences to highlight messages."); } static inline auto SetupAnalysisArguments( diff --git a/src/buildtool/main/main.cpp b/src/buildtool/main/main.cpp index 5f40f698..7b432c16 100644 --- a/src/buildtool/main/main.cpp +++ b/src/buildtool/main/main.cpp @@ -220,6 +220,7 @@ void SetupDefaultLogging() { void SetupLogging(LogArguments const& clargs) { LogConfig::SetLogLimit(clargs.log_limit); + LogConfig::SetSinks({LogSinkCmdLine::CreateFactory(not clargs.plain_log)}); if (clargs.log_file) { LogConfig::AddSink(LogSinkFile::CreateFactory( *clargs.log_file, LogSinkFile::Mode::Overwrite)); |