mirror of
https://github.com/outbackdingo/UltraGrid.git
synced 2026-03-21 09:40:18 +00:00
Logger: switch order of TERM_RESET and '\n'
If logged message ends with '\n', put TERM_RESET before it (it prevents keeping the color if someone writes to stderr directly).
This commit is contained in:
@@ -278,6 +278,9 @@ public:
|
||||
}
|
||||
|
||||
std::string msg = oss.str();
|
||||
if (msg.at(msg.size() - sizeof TERM_RESET) == '\n') { // switch TERM_RESET and '\n'
|
||||
msg.replace(msg.size() - sizeof TERM_RESET, sizeof TERM_RESET + 1, TERM_RESET "\n");
|
||||
}
|
||||
|
||||
if (!get_log_output().is_interactive()) {
|
||||
msg = prune_ansi_sequences_str(msg.c_str());
|
||||
|
||||
Reference in New Issue
Block a user