| 52 | } // namespace |
| 53 | |
| 54 | void CommonLogger::write(const std::string &category, Level level, std::time_t time, const std::string &body) { |
| 55 | if (level <= log_level && m_disabled_categories.count(category) == 0) { |
| 56 | std::string body2 = body; |
| 57 | if (!pattern.empty()) { |
| 58 | size_t insert_pos = 0; |
| 59 | if (body2.size() >= 2 && body2[0] == ILogger::COLOR_PREFIX) { |
| 60 | insert_pos = 2; |
| 61 | } |
| 62 | body2.insert(insert_pos, format_pattern(pattern, category, level, time)); |
| 63 | } |
| 64 | |
| 65 | do_log_string(body2); |
| 66 | } |
| 67 | } |
| 68 | |
| 69 | void CommonLogger::set_pattern(const std::string &pt) { pattern = pt; } |
| 70 |
nothing calls this directly
no test coverage detected