// // logger.cpp // logger // // Created by Sam Jaffe on 9/3/16. // #include "logger/logger.h" #include "common.h" #include "logger_impl.h" #include "logger/logpacket.h" namespace logging { logger::logger(std::string const & name, std::shared_ptr impl) : logger_name_(name), impl_(impl) { } logger::~logger() { if (impl_) impl_->flush(); } void logger::log(level ll, message const & msg) { impl_->write({ now(), ll, {}, logger_name_, msg }); } void logger::log(level ll, location_info const & info, message const & msg) { impl_->write({ now(), ll, info, logger_name_, msg }); } void logger::flush() { impl_->flush(); } }