fix(logger): make null_logger work

This commit is contained in:
Marcus Holland-Moritz 2024-08-07 17:34:41 +02:00
parent 46b3f3cd23
commit 368159f686
2 changed files with 3 additions and 1 deletions

View File

@ -133,7 +133,7 @@ class stream_logger : public logger {
class null_logger : public logger { class null_logger : public logger {
public: public:
null_logger() = default; null_logger();
void write(level_type, const std::string&, char const*, int) override {} void write(level_type, const std::string&, char const*, int) override {}
}; };

View File

@ -103,6 +103,8 @@ std::string logger::all_level_names() {
return result; return result;
} }
null_logger::null_logger() { set_policy<prod_logger_policy>(); }
stream_logger::stream_logger(std::shared_ptr<terminal const> term, stream_logger::stream_logger(std::shared_ptr<terminal const> term,
std::ostream& os, logger_options const& logopts) std::ostream& os, logger_options const& logopts)
: os_(os) : os_(os)