From 939dd9f8176266add4d88572203739fa74b14fa5 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Tue, 19 May 2020 01:24:50 +0100 Subject: refactor(3p/nix/libexpr): Replace logging.h with glog --- third_party/nix/src/libexpr/primops/fetchGit.cc | 6 +++--- third_party/nix/src/libexpr/primops/fetchMercurial.cc | 9 ++++----- 2 files changed, 7 insertions(+), 8 deletions(-) (limited to 'third_party/nix/src/libexpr/primops') diff --git a/third_party/nix/src/libexpr/primops/fetchGit.cc b/third_party/nix/src/libexpr/primops/fetchGit.cc index e1edf9a3e5..07a0770a3f 100644 --- a/third_party/nix/src/libexpr/primops/fetchGit.cc +++ b/third_party/nix/src/libexpr/primops/fetchGit.cc @@ -7,6 +7,7 @@ #include "pathlocks.hh" #include "primops.hh" #include "store-api.hh" +#include using namespace std::string_literals; @@ -119,8 +120,7 @@ GitInfo exportGit(ref store, const std::string& uri, (uint64_t)st.st_mtime + settings.tarballTtl <= (uint64_t)now; } if (doFetch) { - Activity act(*logger, lvlTalkative, actUnknown, - fmt("fetching Git repository '%s'", uri)); + DLOG(INFO) << "fetching Git repository '" << uri << "'"; // FIXME: git stderr messes up our progress indicator, so // we're using --quiet for now. Should process its stderr. @@ -142,7 +142,7 @@ GitInfo exportGit(ref store, const std::string& uri, gitInfo.rev = rev != "" ? rev : chomp(readFile(localRefFile)); gitInfo.shortRev = std::string(gitInfo.rev, 0, 7); - printTalkative("using revision %s of repo '%s'", gitInfo.rev, uri); + DLOG(INFO) << "using revision " << gitInfo.rev << " of repo '" << uri << "'"; std::string storeLinkName = hashString(htSHA512, name + std::string("\0"s) + gitInfo.rev) diff --git a/third_party/nix/src/libexpr/primops/fetchMercurial.cc b/third_party/nix/src/libexpr/primops/fetchMercurial.cc index 1ee12542ef..677855e853 100644 --- a/third_party/nix/src/libexpr/primops/fetchMercurial.cc +++ b/third_party/nix/src/libexpr/primops/fetchMercurial.cc @@ -1,3 +1,4 @@ +#include #include #include #include @@ -36,7 +37,7 @@ HgInfo exportMercurial(ref store, const std::string& uri, /* This is an unclean working tree. So copy all tracked files. */ - printTalkative("copying unclean Mercurial working tree '%s'", uri); + DLOG(INFO) << "copying unclean Mercurial working tree '" << uri << "'"; HgInfo hgInfo; hgInfo.rev = "0000000000000000000000000000000000000000"; @@ -91,8 +92,7 @@ HgInfo exportMercurial(ref store, const std::string& uri, "--template", "1"}) .killStderr(true)) .second == "1")) { - Activity act(*logger, lvlTalkative, actUnknown, - fmt("fetching Mercurial repository '%s'", uri)); + DLOG(INFO) << "fetching Mercurial repository '" << uri << "'"; if (pathExists(cacheDir)) { try { @@ -141,8 +141,7 @@ HgInfo exportMercurial(ref store, const std::string& uri, hgInfo.storePath = json["storePath"]; if (store->isValidPath(hgInfo.storePath)) { - printTalkative("using cached Mercurial store path '%s'", - hgInfo.storePath); + DLOG(INFO) << "using cached Mercurial store path '" << hgInfo.storePath << "'"; return hgInfo; } -- cgit 1.4.1