mirror of
https://github.com/isar/libmdbx.git
synced 2024-10-29 23:19:20 +08:00
test: add log_extra().
This commit is contained in:
parent
677625ead1
commit
ec114d06b7
10
test/log.cc
10
test/log.cc
@ -205,6 +205,16 @@ local_suffix::~local_suffix() { suffix.erase(trim_pos); }
|
||||
|
||||
} /* namespace log */
|
||||
|
||||
void log_extra(const char *msg, ...) {
|
||||
if (logging::extra >= logging::level) {
|
||||
va_list ap;
|
||||
va_start(ap, msg);
|
||||
logging::output(logging::extra, msg, ap);
|
||||
va_end(ap);
|
||||
} else
|
||||
logging::last = nullptr;
|
||||
}
|
||||
|
||||
void log_trace(const char *msg, ...) {
|
||||
if (logging::trace >= logging::level) {
|
||||
va_list ap;
|
||||
|
@ -72,6 +72,7 @@ public:
|
||||
|
||||
} /* namespace log */
|
||||
|
||||
void __printf_args(1, 2) log_extra(const char *msg, ...);
|
||||
void __printf_args(1, 2) log_trace(const char *msg, ...);
|
||||
void __printf_args(1, 2) log_verbose(const char *msg, ...);
|
||||
void __printf_args(1, 2) log_info(const char *msg, ...);
|
||||
|
@ -67,7 +67,7 @@ static void mdbx_debug_logger(int type, const char *function, int line,
|
||||
level = logging::failure;
|
||||
}
|
||||
|
||||
if (logging::output(level, "mdbx: "))
|
||||
if (logging::output(level, "mdbx: %s: ", function))
|
||||
logging::feed(msg, args);
|
||||
if (type & MDBX_DBG_ASSERT)
|
||||
abort();
|
||||
|
Loading…
Reference in New Issue
Block a user