about summary refs log tree commit diff
path: root/third_party/nix/src/nix-store/nix-store.cc
diff options
context:
space:
mode:
authorVincent Ambo <tazjin@google.com>2020-05-19T03·52+0100
committerVincent Ambo <tazjin@google.com>2020-05-19T03·52+0100
commit95a57f15ca795eb1b36363b7d6db6b88bfe444e2 (patch)
treead9328cded554eb7d3e153075c6750a17ca39803 /third_party/nix/src/nix-store/nix-store.cc
parent9aa2ecd78cc865f69a9e978ae55ab0f3eda73c46 (diff)
refactor(3p/nix/nix-*): Replace logging with glog in binaries r/762
Diffstat (limited to 'third_party/nix/src/nix-store/nix-store.cc')
-rw-r--r--third_party/nix/src/nix-store/nix-store.cc14
1 files changed, 7 insertions, 7 deletions
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 <fcntl.h>
+#include <glog/logging.h>
 #include <sys/stat.h>
 #include <sys/types.h>
 #include <algorithm>
@@ -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();
             }
         }