From 1c12498a1bd0f3525476e8d731373f3613813026 Mon Sep 17 00:00:00 2001 From: "jabber.developer2" Date: Tue, 31 Mar 2026 19:58:59 +0300 Subject: [PATCH] upstream: Print PID in debug logs. (1aeb19acb) --- src/log.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/log.c b/src/log.c index e6d10a71..1a05f9bf 100644 --- a/src/log.c +++ b/src/log.c @@ -60,6 +60,7 @@ static FILE* logp; static gchar* mainlogfile = NULL; static gboolean user_provided_log = FALSE; static log_level_t level_filter; +static pid_t prof_pid; static int stderr_inited; static log_level_t stderr_level; @@ -198,6 +199,8 @@ log_init(log_level_t filter, const char* const log_file) logp = fopen(mainlogfile, "a"); g_chmod(mainlogfile, S_IRUSR | S_IWUSR); + + prof_pid = getpid(); } const gchar* @@ -231,7 +234,7 @@ _log_msg(log_level_t level, const char* const area, const char* const msg) auto_gchar gchar* date_fmt = g_date_time_format_iso8601(dt); - fprintf(logp, "%s: %s: %s: %s\n", date_fmt, area, level_str, msg); + fprintf(logp, "%s: %08d: %s: %s: %s\n", date_fmt, prof_pid, area, level_str, msg); g_date_time_unref(dt); fflush(logp);