From 15e9564fd1e11b3797f0188a494aa66d4622dfb0 Mon Sep 17 00:00:00 2001 From: Ben Burdette Date: Sun, 19 Apr 2020 17:16:51 -0600 Subject: [PATCH] logEI for tunnelLogger and progressbar --- src/libstore/daemon.cc | 8 ++++++++ src/nix/progress-bar.cc | 6 +++++- 2 files changed, 13 insertions(+), 1 deletion(-) diff --git a/src/libstore/daemon.cc b/src/libstore/daemon.cc index c8daef57c..d985f151b 100644 --- a/src/libstore/daemon.cc +++ b/src/libstore/daemon.cc @@ -75,6 +75,14 @@ struct TunnelLogger : public Logger void logEI(const ErrorInfo & ei) override { + if (ei.level > verbosity) return; + + std::stringstream oss; + oss << ei; + + StringSink buf; + buf << STDERR_NEXT << oss.str() << "\n"; // (fs.s + "\n"); + enqueueMsg(*buf.s); } /* startWork() means that we're starting an operation for which we diff --git a/src/nix/progress-bar.cc b/src/nix/progress-bar.cc index 41f3d4cd7..b1226d550 100644 --- a/src/nix/progress-bar.cc +++ b/src/nix/progress-bar.cc @@ -127,7 +127,11 @@ public: void logEI(const ErrorInfo &ei) override { auto state(state_.lock()); - // log(*state, lvl, ei.as_str()); + + std::stringstream oss; + oss << ei; + + log(*state, ei.level, oss.str()); } void log(State & state, Verbosity lvl, const std::string & s)