mdbx-test: minor refactor mdbx_logger().

Change-Id: I058be7e01b5fc031610363bf6747ae7f62ba4c67
This commit is contained in:
Leonid Yuriev 2021-01-30 18:51:55 +03:00
parent edb6d2d661
commit b57a338546

View File

@ -38,18 +38,17 @@ MDBX_NORETURN void failure_perror(const char *what, int errnum) {
//-----------------------------------------------------------------------------
static void mdbx_logger(MDBX_log_level_t priority, const char *function,
int line, const char *msg,
int line, const char *fmt,
va_list args) MDBX_CXX17_NOEXCEPT {
if (!function)
function = "unknown";
if (priority == MDBX_LOG_FATAL)
log_error("mdbx: fatal failure: %s, %d", function, line);
logging::output_nocheckloglevel(
logging::loglevel(priority),
strncmp(function, "mdbx_", 5) == 0 ? "%s: " : "mdbx %s: ", function);
logging::feed_ap(msg, args);
if (function) {
if (priority == MDBX_LOG_FATAL)
log_error("mdbx: fatal failure: %s, %d", function, line);
logging::output_nocheckloglevel(
logging::loglevel(priority),
strncmp(function, "mdbx_", 5) == 0 ? "%s: " : "mdbx %s: ", function);
logging::feed_ap(fmt, args);
} else
logging::feed_ap(fmt, args);
}
namespace logging {