logEI for tunnelLogger and progressbar

This commit is contained in:
Ben Burdette 2020-04-19 17:16:51 -06:00
parent 4697552948
commit 15e9564fd1
2 changed files with 13 additions and 1 deletions

View file

@ -75,6 +75,14 @@ struct TunnelLogger : public Logger
void logEI(const ErrorInfo & ei) override 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 /* startWork() means that we're starting an operation for which we

View file

@ -127,7 +127,11 @@ public:
void logEI(const ErrorInfo &ei) override void logEI(const ErrorInfo &ei) override
{ {
auto state(state_.lock()); 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) void log(State & state, Verbosity lvl, const std::string & s)