mirror of
https://github.com/outbackdingo/UltraGrid.git
synced 2026-03-21 08:40:19 +00:00
one-shot logger updates
On one-shot second and further calls of one-shot message, no output was
producet, yet empty buffer was submitted to Log_output resulting in
false repeate messages:
Last message repeated <n> times
To simplify the stuff, C++ API was removed and in the C API the Logger
is taken only if actual message will be output. If someone is willing to
use the C++ API, it can be later readded (not really needed now, only
simple message are presented).
This commit is contained in:
@@ -141,10 +141,11 @@ void log_msg(int level, const char *format, ...) {
|
||||
}
|
||||
|
||||
void log_msg_once(int level, uint32_t id, const char *msg) {
|
||||
if (log_level < level) {
|
||||
if (Logger::oneshot_messages.count(id) > 0 || log_level < level) {
|
||||
return;
|
||||
}
|
||||
Logger(level).once(id, msg);
|
||||
Logger::oneshot_messages.insert(id);
|
||||
Logger(level).Get() << msg;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user