| 12345678910111213141516171819202122232425262728293031 |
- //
- // logger_impl.cxx
- // logging
- //
- // Created by Sam Jaffe on 4/3/19.
- //
- #include "logger_impl.h"
- #include "logger/detail/appender.h"
- #include "logger/detail/layout.h"
- using namespace logging;
- bool logger_impl::should_log(log_level ll) const {
- return ll >= min_log_level_;
- }
- void logger_impl::write(logpacket const & pkt) {
- for (auto & pair : impls_) {
- if (pair.first->should_log(pkt.level)) {
- pair.first->write(pair.second->format(pkt));
- }
- }
- }
- void logger_impl::flush() {
- for (auto & pair : impls_) {
- pair.first->flush();
- }
- }
|