| 56 | } |
| 57 | |
| 58 | void LogTerminal::print(Level level, std::string_view message) |
| 59 | { |
| 60 | if (!passesLevelFilter(level)) |
| 61 | { |
| 62 | return; |
| 63 | } |
| 64 | |
| 65 | std::string timestamp; |
| 66 | if (getWriteTimestamps()) |
| 67 | { |
| 68 | auto now = std::chrono::system_clock::now(); |
| 69 | timestamp = fmt::format("[{:%Y-%m-%d %H:%M:%S}] ", std::chrono::floor<std::chrono::seconds>(now)); |
| 70 | } |
| 71 | |
| 72 | const int intendSize = getIntendSize(); |
| 73 | |
| 74 | if (_vt100Enabled) |
| 75 | { |
| 76 | fmt::print(getOutputStream(level), getTextStyle(level), "{}{:>{}}\n", timestamp, message, intendSize); |
| 77 | } |
| 78 | else |
| 79 | { |
| 80 | fmt::print(getOutputStream(level), "{}{}{:<{}}\n", timestamp, getLevelPrefix(level), message, intendSize); |
| 81 | } |
| 82 | } |
| 83 | |
| 84 | } |
nothing calls this directly
no test coverage detected