aboutsummaryrefslogtreecommitdiff
path: root/src/libmain/loggers.cc
diff options
context:
space:
mode:
authorFinn Behrens <me@kloenk.dev>2024-06-01 16:06:26 +0200
committerFinn Behrens <me@kloenk.dev>2024-06-22 14:20:27 +0200
commitda4e46dd1fc04067b5ba4bc16dd68134fa7efad2 (patch)
treede928e67208328cac91b1afb8ce368918f0b8266 /src/libmain/loggers.cc
parent21865ccce0a5bf6edcb98a09b57b3f076ee9ba9f (diff)
libmain: add progress bar with multiple status lines
Add the log-formats `multiline` and `multiline-with-logs` which offer multiple current active building status lines. Change-Id: Idd8afe62f8591b5d8b70e258c5cefa09be4cab03
Diffstat (limited to 'src/libmain/loggers.cc')
-rw-r--r--src/libmain/loggers.cc15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/libmain/loggers.cc b/src/libmain/loggers.cc
index 80080d616..8c3c4e355 100644
--- a/src/libmain/loggers.cc
+++ b/src/libmain/loggers.cc
@@ -17,6 +17,10 @@ LogFormat parseLogFormat(const std::string & logFormatStr) {
return LogFormat::bar;
else if (logFormatStr == "bar-with-logs")
return LogFormat::barWithLogs;
+ else if (logFormatStr == "multiline")
+ return LogFormat::multiline;
+ else if (logFormatStr == "multiline-with-logs")
+ return LogFormat::multilineWithLogs;
throw Error("option 'log-format' has an invalid value '%s'", logFormatStr);
}
@@ -35,6 +39,17 @@ Logger * makeDefaultLogger() {
logger->setPrintBuildLogs(true);
return logger;
}
+ case LogFormat::multiline: {
+ auto logger = makeProgressBar();
+ logger->setPrintMultiline(true);
+ return logger;
+ }
+ case LogFormat::multilineWithLogs: {
+ auto logger = makeProgressBar();
+ logger->setPrintMultiline(true);
+ logger->setPrintBuildLogs(true);
+ return logger;
+ }
default:
abort();
}