enhance: when setting the log output file, stellar still outputs necessary log information to stderr

This commit is contained in:
luwenpeng
2024-08-14 14:27:38 +08:00
parent e8299dd77c
commit 5abf0d7942
3 changed files with 8 additions and 2 deletions

View File

@@ -321,5 +321,11 @@ void log_print(enum log_level level, const char *module, const char *fmt, ...)
{
nwrite = write(g_log_ctx->log_fd, buf, p - buf);
} while (nwrite == -1 && errno == EINTR);
// log level is LOG_STATE, also print to stderr
if (level == LOG_STATE)
{
fprintf(stderr, "%s", buf);
}
}
}