]> mj.ucw.cz Git - libucw.git/blobdiff - ucw/log.c
Logging: Adapted the `logger' utility to the new numbering of levels.
[libucw.git] / ucw / log.c
index 2563c799aa0b09f995e54b42592ad08deef228a7..5c4a006982f863b760e9309d34deb51eaaa05e09 100644 (file)
--- a/ucw/log.c
+++ b/ucw/log.c
@@ -219,7 +219,7 @@ log_pass_msg(int depth, struct log_stream *ls, struct log_msg *m)
   /* Process name, PID ( |log_title| + 6 + (|PID|<=10) chars ) */
   if ((ls->msgfmt & LSFMT_TITLE) && log_title)
     {
   /* Process name, PID ( |log_title| + 6 + (|PID|<=10) chars ) */
   if ((ls->msgfmt & LSFMT_TITLE) && log_title)
     {
-      if (ls->msgfmt & LSFMT_PID)
+      if ((ls->msgfmt & LSFMT_PID) && log_pid)
        p += sprintf(p, "[%s (%d)] ", log_title, log_pid);
       else
        p += sprintf(p, "[%s] ", log_title);
        p += sprintf(p, "[%s (%d)] ", log_title, log_pid);
       else
        p += sprintf(p, "[%s] ", log_title);