about summary refs log tree commit diff
path: root/third_party/nix/src/nix-env/user-env.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-env/user-env.cc
parent9aa2ecd78cc865f69a9e978ae55ab0f3eda73c46 (diff)
refactor(3p/nix/nix-*): Replace logging with glog in binaries r/762
Diffstat (limited to 'third_party/nix/src/nix-env/user-env.cc')
-rw-r--r--third_party/nix/src/nix-env/user-env.cc14
1 files changed, 7 insertions, 7 deletions
diff --git a/third_party/nix/src/nix-env/user-env.cc b/third_party/nix/src/nix-env/user-env.cc
index c1c174bcc529..b8d168c8355b 100644
--- a/third_party/nix/src/nix-env/user-env.cc
+++ b/third_party/nix/src/nix-env/user-env.cc
@@ -1,4 +1,5 @@
 #include "user-env.hh"
+#include <glog/logging.h>
 #include "derivations.hh"
 #include "eval-inline.hh"
 #include "eval.hh"
@@ -30,7 +31,7 @@ bool createUserEnv(EvalState& state, DrvInfos& elems, const Path& profile,
   for (auto& i : elems)
     if (i.queryDrvPath() != "") drvsToBuild.insert(i.queryDrvPath());
 
-  debug(format("building user environment dependencies"));
+  DLOG(INFO) << "building user environment dependencies";
   state.store->buildPaths(drvsToBuild, state.repair ? bmRepair : bmNormal);
 
   /* Construct the whole top level derivation. */
@@ -111,7 +112,7 @@ bool createUserEnv(EvalState& state, DrvInfos& elems, const Path& profile,
   mkApp(topLevel, envBuilder, args);
 
   /* Evaluate it. */
-  debug("evaluating user environment builder");
+  DLOG(INFO) << "evaluating user environment builder";
   state.forceValue(topLevel);
   PathSet context;
   Attr& aDrvPath(*topLevel.attrs->find(state.sDrvPath));
@@ -122,7 +123,7 @@ bool createUserEnv(EvalState& state, DrvInfos& elems, const Path& profile,
                                         *(aOutPath.value), context);
 
   /* Realise the resulting store expression. */
-  debug("building user environment");
+  DLOG(INFO) << "building user environment";
   state.store->buildPaths({topLevelDrv}, state.repair ? bmRepair : bmNormal);
 
   /* Switch the current user environment to the output path. */
@@ -134,13 +135,12 @@ bool createUserEnv(EvalState& state, DrvInfos& elems, const Path& profile,
 
     Path lockTokenCur = optimisticLockProfile(profile);
     if (lockToken != lockTokenCur) {
-      printError(
-          format("profile '%1%' changed while we were busy; restarting") %
-          profile);
+      LOG(WARNING) << "profile '" << profile
+                   << "' changed while we were busy; restarting";
       return false;
     }
 
-    debug(format("switching to new user environment"));
+    DLOG(INFO) << "switching to new user environment";
     Path generation =
         createGeneration(ref<LocalFSStore>(store2), profile, topLevelOut);
     switchLink(profile, generation);