MCPcopy Create free account
hub / github.com/bcndev/bytecoin / write

Method write

src/logging/CommonLogger.cpp:54–67  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52} // namespace
53
54void 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
69void CommonLogger::set_pattern(const std::string &pt) { pattern = pt; }
70

Callers

nothing calls this directly

Calls 3

format_patternFunction · 0.85
emptyMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected