index 59124bd9ccb86a32ac42ca8b9cb4a6f0f01ff13d..95f32de4e29c6b9bd79a52e9f1b677db5de18743 100644 (file)
@@ -2438,10 +2438,19 @@ 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;
}
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 != '%')
{
index f5c6cd904de925db6819e56e4869a27b620b090c..68ead8e8736587cb2d248f9ef5a72f81f4bf7356 100644 (file)
#include <setjmp.h>
+#include "lib/stringinfo.h"
+
/* Error level codes */
#define DEBUG5 10 /* Debugging messages, in categories of
* decreasing detail. */
@@ -439,6 +441,8 @@ extern PGDLLIMPORT bool syslog_split_messages;
#define LOG_DESTINATION_JSONLOG 16
/* Other exported functions */
+extern void log_status_format(StringInfo buf, const char *format,
+ ErrorData *edata);
extern void DebugFileOpen(void);
extern char *unpack_sql_state(int sql_state);
extern bool in_error_recursion_trouble(void);