File tree 2 files changed +16
-3
lines changed 2 files changed +16
-3
lines changed Original file line number Diff line number Diff line change @@ -2438,10 +2438,19 @@ process_log_prefix_padding(const char *p, int *ppadding)
2438
2438
}
2439
2439
2440
2440
/*
2441
- * Format tag info for log lines; append to the provided buffer .
2441
+ * Format log status information using Log_line_prefix .
2442
2442
*/
2443
2443
static void
2444
2444
log_line_prefix (StringInfo buf , ErrorData * edata )
2445
+ {
2446
+ log_status_format (buf , Log_line_prefix , edata );
2447
+ }
2448
+
2449
+ /*
2450
+ * Format log status info; append to the provided buffer.
2451
+ */
2452
+ void
2453
+ log_status_format (StringInfo buf , const char * format , ErrorData * edata )
2445
2454
{
2446
2455
/* static counter for line numbers */
2447
2456
static long log_line_number = 0 ;
@@ -2465,10 +2474,10 @@ log_line_prefix(StringInfo buf, ErrorData *edata)
2465
2474
}
2466
2475
log_line_number ++ ;
2467
2476
2468
- if (Log_line_prefix == NULL )
2477
+ if (format == NULL )
2469
2478
return ; /* in case guc hasn't run yet */
2470
2479
2471
- for (p = Log_line_prefix ; * p != '\0' ; p ++ )
2480
+ for (p = format ; * p != '\0' ; p ++ )
2472
2481
{
2473
2482
if (* p != '%' )
2474
2483
{
Original file line number Diff line number Diff line change 16
16
17
17
#include <setjmp.h>
18
18
19
+ #include "lib/stringinfo.h"
20
+
19
21
/* Error level codes */
20
22
#define DEBUG5 10 /* Debugging messages, in categories of
21
23
* decreasing detail. */
@@ -439,6 +441,8 @@ extern PGDLLIMPORT bool syslog_split_messages;
439
441
#define LOG_DESTINATION_JSONLOG 16
440
442
441
443
/* Other exported functions */
444
+ extern void log_status_format (StringInfo buf , const char * format ,
445
+ ErrorData * edata );
442
446
extern void DebugFileOpen (void );
443
447
extern char * unpack_sql_state (int sql_state );
444
448
extern bool in_error_recursion_trouble (void );
You can’t perform that action at this time.
0 commit comments