X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=src%2Fshared%2Flog.c;h=6f17705abfad8869717f9522f570d7e892486102;hb=2e78fa79bbaebb358d2657c397180d2d08d69b12;hp=a4b3b68ef181e316f74da46f18dbd9399c595784;hpb=03e334a1c7dc8c20c38902aa039440763acc9b17;p=elogind.git diff --git a/src/shared/log.c b/src/shared/log.c index a4b3b68ef..6f17705ab 100644 --- a/src/shared/log.c +++ b/src/shared/log.c @@ -378,7 +378,7 @@ static int write_to_syslog( if (strftime(header_time, sizeof(header_time), "%h %e %T ", tm) <= 0) return -EINVAL; - snprintf(header_pid, sizeof(header_pid), "[%lu]: ", (unsigned long) getpid()); + snprintf(header_pid, sizeof(header_pid), "["PID_FMT"]: ", getpid()); char_array_0(header_pid); IOVEC_SET_STRING(iovec[0], header_priority); @@ -426,7 +426,7 @@ static int write_to_kmsg( snprintf(header_priority, sizeof(header_priority), "<%i>", level); char_array_0(header_priority); - snprintf(header_pid, sizeof(header_pid), "[%lu]: ", (unsigned long) getpid()); + snprintf(header_pid, sizeof(header_pid), "["PID_FMT"]: ", getpid()); char_array_0(header_pid); IOVEC_SET_STRING(iovec[0], header_priority); @@ -878,6 +878,9 @@ void log_parse_environment(void) { if (l == 5 && startswith(w, "debug")) { log_set_max_level(LOG_DEBUG); break; + } else if (l == 5 && startswith(w, "quiet")) { + log_set_max_level(LOG_WARNING); + break; } } }