diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2023-03-02 15:44:19 +0100 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2023-03-02 15:57:54 +0100 |
commit | 29abc8e7647cd9ec6ef5a1df3fcb1dcf4a4495a2 (patch) | |
tree | 0461f565859916470a054f9db68df280090d4dc1 /src/libutil/logging.cc | |
parent | b9370fd7a040558cc8c7d5db109fdd3e407ff409 (diff) |
Remove FormatOrString and remaining uses of format()
Diffstat (limited to 'src/libutil/logging.cc')
-rw-r--r-- | src/libutil/logging.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/libutil/logging.cc b/src/libutil/logging.cc index 56bdaf87a..7cac75ce1 100644 --- a/src/libutil/logging.cc +++ b/src/libutil/logging.cc @@ -54,7 +54,7 @@ public: return printBuildLogs; } - void log(Verbosity lvl, const FormatOrString & fs) override + void log(Verbosity lvl, std::string_view s) override { if (lvl > verbosity) return; @@ -72,7 +72,7 @@ public: prefix = std::string("<") + c + ">"; } - writeToStderr(prefix + filterANSIEscapes(fs.s, !tty) + "\n"); + writeToStderr(prefix + filterANSIEscapes(s, !tty) + "\n"); } void logEI(const ErrorInfo & ei) override @@ -174,12 +174,12 @@ struct JSONLogger : Logger { prevLogger.log(lvlError, "@nix " + json.dump(-1, ' ', false, nlohmann::json::error_handler_t::replace)); } - void log(Verbosity lvl, const FormatOrString & fs) override + void log(Verbosity lvl, std::string_view s) override { nlohmann::json json; json["action"] = "msg"; json["level"] = lvl; - json["msg"] = fs.s; + json["msg"] = s; write(json); } |