Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: do not write error twice to stderr #1555

Merged
merged 2 commits into from
Sep 6, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/libcrun/error.c
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,8 @@ log_write_to_stream (int errno_, const char *msg, int verbosity, void *arg)
switch (verbosity)
{
case LIBCRUN_VERBOSITY_DEBUG:
color_begin = "\x1b[1;34m";
color_end = "\x1b[0m";
break;
case LIBCRUN_VERBOSITY_WARNING:
color_begin = "\x1b[1;33m";
Expand Down Expand Up @@ -432,7 +434,7 @@ write_log (int errno_, int verbosity, const char *msg, va_list args_list)
if (UNLIKELY (ret < 0))
OOM ();

if (verbosity == LIBCRUN_VERBOSITY_ERROR)
if (verbosity == LIBCRUN_VERBOSITY_ERROR && output_handler != log_write_to_stderr)
log_write_to_stderr (errno_, output, LIBCRUN_VERBOSITY_ERROR, NULL);

switch (log_format)
Expand Down
Loading