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