You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

24 lines
465 B

  1. #include <cpputils/logging/logger_impl.h>
  2. using namespace ::utl::logging;
  3. const std::string& logger_impl::name() const
  4. { return _name; }
  5. bool logger_impl::is_enabled(log_level level) const
  6. {
  7. for (auto& rule : _rules)
  8. {
  9. if (rule->is_enabled(level))
  10. return true;
  11. }
  12. return false;
  13. }
  14. void logger_impl::log(data_ptr_s data) const
  15. {
  16. std::lock_guard<std::mutex> lk(_mutex);
  17. for (auto& r : _rules)
  18. r->log(data);
  19. }