11 void info(
const std::string& str)
override
13 std::cout << str <<
"\n";
16 void warn(
const std::string & str)
override
18 std::cerr << str <<
"\n";
21 void error(
const std::string & str)
override
23 std::cerr << str <<
"\n";
36 static ConsoleLogger console_logger;
37 Logger* logger = global_logger;
39 if (logger !=
nullptr) {
return logger; }
40 else {
return &console_logger; }
46 assert(global_logger);
47 global_logger = new_log;
52 global_logger =
nullptr;
Logger * get_global_logger()
virtual void warn(const std::string &str)=0
virtual void info(const std::string &str)=0
virtual void error(const std::string &str)=0
ScopedLogger(Logger *new_log)