Whamcloud - gitweb
LU-10480 liblustre: suppress progname prefix in output
[fs/lustre-release.git] / lustre / utils / liblustreapi.c
index 7280528..a97ecb5 100644 (file)
@@ -129,11 +129,15 @@ static void error_callback_default(enum llapi_message_level level, int err,
 static void info_callback_default(enum llapi_message_level level, int err,
                                  const char *fmt, va_list ap)
 {
-       if (liblustreapi_cmd != NULL)
-               fprintf(stderr, "%s %s: ", program_invocation_short_name,
-                       liblustreapi_cmd);
-       else
-               fprintf(stderr, "%s: ", program_invocation_short_name);
+       if (err != 0) {
+               if (liblustreapi_cmd != NULL) {
+                       fprintf(stdout, "%s %s: ",
+                               program_invocation_short_name,
+                               liblustreapi_cmd);
+               } else {
+                       fprintf(stdout, "%s: ", program_invocation_short_name);
+               }
+       }
        vfprintf(stdout, fmt, ap);
 }