Both vshWarn and vshError are just wrappers around vshPrintStderr which
properly propagates the message level to the log, but fails to honor it
when printing on stderr.
https://issues.redhat.com/browse/RHEL-79460
Signed-off-by: Jiri Denemark <jdenemar@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
* printing to stderr will not interleave correctly with stdout
* unless we flush between every transition between streams. */
fflush(stdout);
- fprintf(stderr, _("error: %1$s\n"), NULLSTR(str));
+
+ if (level == VSH_ERR_WARNING)
+ fprintf(stderr, _("warning: %1$s\n"), NULLSTR(str));
+ else
+ fprintf(stderr, _("error: %1$s\n"), NULLSTR(str));
fflush(stderr);
}