- tim = time(NULL);
- tm = localtime(&tim);
- strftime(buf, sizeof(buf), "%d-%m-%Y %H:%M:%S", tm);
- fprintf(stderr, "%s %s [%d] <%d> ", buf, progname, pid, level);
+ if (!log_pid)
+ log_pid = getpid();
+ strftime(buf, sizeof(buf), "%Y-%m-%d %H:%M:%S", tm);
+ fprintf(stderr, "%c %s ", cat, buf);
+ if (log_progname)
+ fprintf(stderr, "[%s (%d)] ", log_progname, log_pid);