From 95a57f15ca795eb1b36363b7d6db6b88bfe444e2 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Tue, 19 May 2020 04:52:47 +0100 Subject: refactor(3p/nix/nix-*): Replace logging with glog in binaries --- third_party/nix/src/nix-store/nix-store.cc | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'third_party/nix/src/nix-store') diff --git a/third_party/nix/src/nix-store/nix-store.cc b/third_party/nix/src/nix-store/nix-store.cc index 7f576b1b3e..0e42dfd34a 100644 --- a/third_party/nix/src/nix-store/nix-store.cc +++ b/third_party/nix/src/nix-store/nix-store.cc @@ -1,4 +1,5 @@ #include +#include #include #include #include @@ -715,7 +716,7 @@ static void opVerify(Strings opFlags, Strings opArgs) { throw UsageError(format("unknown flag '%1%'") % i); if (store->verifyStore(checkContents, repair)) { - printError("warning: not all errors were fixed"); + LOG(WARNING) << "not all errors were fixed"; throw Exit(1); } } @@ -728,15 +729,15 @@ static void opVerifyPath(Strings opFlags, Strings opArgs) { for (auto& i : opArgs) { Path path = store->followLinksToStorePath(i); - printMsg(lvlTalkative, format("checking path '%1%'...") % path); + LOG(INFO) << "checking path '" << path << "'..."; auto info = store->queryPathInfo(path); HashSink sink(info->narHash.type); store->narFromPath(path, sink); auto current = sink.finish(); if (current.first != info->narHash) { - printError( - format("path '%1%' was modified! expected hash '%2%', got '%3%'") % - path % info->narHash.to_string() % current.first.to_string()); + LOG(ERROR) << "path '" << path << "' was modified! expected hash '" + << info->narHash.to_string() << "', got '" + << current.first.to_string() << "'"; status = 1; } } @@ -788,7 +789,6 @@ static void opServe(Strings opFlags, Strings opArgs) { auto getBuildSettings = [&]() { // FIXME: changing options here doesn't work if we're // building through the daemon. - verbosity = lvlError; settings.keepLog = false; settings.useSubstitutes = false; settings.maxSilentTime = readInt(in); @@ -836,7 +836,7 @@ static void opServe(Strings opFlags, Strings opArgs) { if (!willSubstitute.empty()) try { store->buildPaths(willSubstitute); } catch (Error& e) { - printError(format("warning: %1%") % e.msg()); + LOG(WARNING) << e.msg(); } } -- cgit 1.4.1