diff --git a/source/common/logger/ur_sinks.hpp b/source/common/logger/ur_sinks.hpp index f63d30d809..925a5acc9a 100644 --- a/source/common/logger/ur_sinks.hpp +++ b/source/common/logger/ur_sinks.hpp @@ -67,16 +67,17 @@ class Sink { if (*(++fmt) == '{') { buffer << *fmt++; } else { - std::cerr - << error_prefix - << "No arguments provided and braces not escaped!"; + std::cerr << error_prefix + << "No arguments provided and braces not escaped!" + << std::endl; } } else if (*fmt == '}') { if (*(++fmt) == '}') { buffer << *fmt++; } else { std::cerr << error_prefix - << "Closing curly brace not escaped!"; + << "Closing curly brace not escaped!" + << std::endl; } } } @@ -97,7 +98,7 @@ class Sink { buffer << *fmt++; } else if (*fmt != '}') { std::cerr << error_prefix - << "Only empty braces are allowed!"; + << "Only empty braces are allowed!" << std::endl; } else { buffer << arg; arg_printed = true; @@ -107,9 +108,17 @@ class Sink { buffer << *fmt++; } else { std::cerr << error_prefix - << "Closing curly brace not escaped!"; + << "Closing curly brace not escaped!" + << std::endl; } } + + if (*fmt == '\0') { + std::cerr << error_prefix << "Too many arguments!" << std::endl; + // ignore all left arguments and finalize message + format(buffer, fmt); + return; + } } format(buffer, ++fmt, std::forward(args)...);