aboutsummaryrefslogtreecommitdiff
path: root/src/backend
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend')
-rw-r--r--src/backend/utils/error/elog.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/src/backend/utils/error/elog.c b/src/backend/utils/error/elog.c
index 59124bd9ccb..95f32de4e29 100644
--- a/src/backend/utils/error/elog.c
+++ b/src/backend/utils/error/elog.c
@@ -2438,11 +2438,20 @@ process_log_prefix_padding(const char *p, int *ppadding)
}
/*
- * Format tag info for log lines; append to the provided buffer.
+ * Format log status information using Log_line_prefix.
*/
static void
log_line_prefix(StringInfo buf, ErrorData *edata)
{
+ log_status_format(buf, Log_line_prefix, edata);
+}
+
+/*
+ * Format log status info; append to the provided buffer.
+ */
+void
+log_status_format(StringInfo buf, const char *format, ErrorData *edata)
+{
/* static counter for line numbers */
static long log_line_number = 0;
@@ -2465,10 +2474,10 @@ log_line_prefix(StringInfo buf, ErrorData *edata)
}
log_line_number++;
- if (Log_line_prefix == NULL)
+ if (format == NULL)
return; /* in case guc hasn't run yet */
- for (p = Log_line_prefix; *p != '\0'; p++)
+ for (p = format; *p != '\0'; p++)
{
if (*p != '%')
{