From 6dc6c29fa4a4ddd3bb72f8415fac5936d719bd44 Mon Sep 17 00:00:00 2001 From: Vincent Ambo Date: Mon, 18 May 2020 02:34:41 +0100 Subject: refactor(3p/nix/libutil): Replace internal logging library with glog --- third_party/nix/src/libutil/archive.cc | 17 +++++++++++------ 1 file changed, 11 insertions(+), 6 deletions(-) (limited to 'third_party/nix/src/libutil/archive.cc') diff --git a/third_party/nix/src/libutil/archive.cc b/third_party/nix/src/libutil/archive.cc index 9ae5c76db7..8f98a3daf3 100644 --- a/third_party/nix/src/libutil/archive.cc +++ b/third_party/nix/src/libutil/archive.cc @@ -10,6 +10,7 @@ #include #include #include "config.hh" +#include "glog/logging.h" #include "util.hh" namespace nix { @@ -61,8 +62,9 @@ static void dump(const Path& path, Sink& sink, PathFilter& filter) { checkInterrupt(); struct stat st; - if (lstat(path.c_str(), &st)) + if (lstat(path.c_str(), &st)) { throw SysError(format("getting attributes of path '%1%'") % path); + } sink << "("; @@ -87,8 +89,9 @@ static void dump(const Path& path, Sink& sink, PathFilter& filter) { string name(i.name); size_t pos = i.name.find(caseHackSuffix); if (pos != string::npos) { - debug(format("removing case hack suffix from '%1%'") % - (path + "/" + i.name)); + DLOG(INFO) << "removing case hack suffix from " << path << "/" + << i.name; + name.erase(pos); } if (unhacked.find(name) != unhacked.end()) @@ -247,15 +250,17 @@ static void parse(ParseSink& sink, Source& source, const Path& path) { if (archiveSettings.useCaseHack) { auto i = names.find(name); if (i != names.end()) { - debug(format("case collision between '%1%' and '%2%'") % - i->first % name); + DLOG(INFO) << "case collision between '" << i->first << "' and '" + << name << "'"; name += caseHackSuffix; name += std::to_string(++i->second); } else names[name] = 0; } } else if (s == "node") { - if (s.empty()) throw badArchive("entry name missing"); + if (s.empty()) { + throw badArchive("entry name missing"); + } parse(sink, source, path + "/" + name); } else throw badArchive("unknown field " + s); -- cgit 1.4.1