mirror of
https://gitflic.ru/project/erthink/libmdbx.git
synced 2025-03-11 23:52:13 +00:00
test: use stderr for error only.
This commit is contained in:
parent
4c97997602
commit
8167a08431
@ -68,12 +68,13 @@ const char *level2str(const loglevel level) {
|
|||||||
|
|
||||||
void output(loglevel priority, const char *format, va_list ap) {
|
void output(loglevel priority, const char *format, va_list ap) {
|
||||||
if (priority >= level) {
|
if (priority >= level) {
|
||||||
fprintf(stderr, "[ %u %-10s %6s ] " /* TODO */, osal_getpid(),
|
FILE *out = (priority >= error) ? stderr : stdout;
|
||||||
prefix.c_str(), level2str(priority));
|
fprintf(out, "[ %u %-10s %6s ] " /* TODO */, osal_getpid(), prefix.c_str(),
|
||||||
vfprintf(stderr, format, ap);
|
level2str(priority));
|
||||||
|
vfprintf(out, format, ap);
|
||||||
size_t len = strlen(format);
|
size_t len = strlen(format);
|
||||||
if (len && format[len - 1] != '\n')
|
if (len && format[len - 1] != '\n')
|
||||||
putc('\n', stderr);
|
putc('\n', out);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user