1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-28 09:31:16 +02:00

Remove FormatOrString and remaining uses of format()

This commit is contained in:
Eelco Dolstra 2023-03-02 15:44:19 +01:00
parent b9370fd7a0
commit 29abc8e764
40 changed files with 102 additions and 125 deletions

View file

@ -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);
}