Commit 7fdee874 authored by Johan Ström's avatar Johan Ström

Unbreak agolog_basic

parent 8e29c528
Pipeline #451 passed with stage
in 2 minutes and 43 seconds
......@@ -92,6 +92,10 @@ public:
static const std::vector<std::string> & getLevels();
protected:
#ifndef HAVE_BOOST_LOG
friend class simple_logger;
#endif
static severity_level getDefaultLevel();
};
......
......@@ -75,15 +75,18 @@ void log_container::initDefault() {
if(inited)
return;
inited = true;
get().setLevel(AGO_DEFAULT_LEVEL);
// Default inited with console sink
// Nothing to init here.. the simple_logger instance constructor sets default level & creates
// console sink
}
void log_container::setCurrentLevel(severity_level lvl, const std::map<std::string, severity_level>& ignored) {
get().setLevel(lvl);
}
simple_logger::simple_logger()
: current_level(log_container::getDefaultLevel())
, sink( boost::shared_ptr<log_sink>(new console_sink()) )
{}
}/* namespace log */
}/* namespace agocontrol */
......@@ -110,7 +110,7 @@ public:
class simple_logger {
friend class record_pump;
private:
private:
severity_level current_level;
boost::shared_ptr<log_sink> sink;
......@@ -119,11 +119,8 @@ class simple_logger {
sink->output_record(rec);
}
public:
simple_logger()
: current_level(getDefaultLevel())
, sink( boost::shared_ptr<log_sink>(new console_sink()) )
{}
public:
simple_logger();
simple_logger(severity_level severity)
: current_level(severity) {}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment