diff --git a/include/qb/qblog.h b/include/qb/qblog.h index 7961209..9b1b0cf 100644 --- a/include/qb/qblog.h +++ b/include/qb/qblog.h @@ -478,6 +478,7 @@ void qb_log_tags_stringify_fn_set(qb_log_tags_stringify_fn fn); * %b BUFFER * %g TAGS * %N name (passed into qb_log_init) + * %P PID * * any number between % and character specify field length to pad or chop */ diff --git a/lib/log_format.c b/lib/log_format.c index a626cae..70eaedb 100644 --- a/lib/log_format.c +++ b/lib/log_format.c @@ -253,6 +253,11 @@ qb_log_target_format(int32_t target, } break; + case 'P': + snprintf(line_no, 30, "%d", getpid()); + p = line_no; + break; + default: p = ""; break;