7979#include "utils/ps_status.h"
8080
8181
82+ /* In this module, access gettext() via err_gettext() */
8283#undef _
8384#define _ (x ) err_gettext(x)
8485
85- static const char * err_gettext (const char * str ) pg_attribute_format_arg (1 );
86- static void set_errdata_field (MemoryContextData * cxt , char * * ptr , const char * str );
8786
8887/* Global variables */
8988ErrorContextCallback * error_context_stack = NULL ;
@@ -129,10 +128,9 @@ static int syslog_facility = LOG_LOCAL0;
129128static void write_syslog (int level , const char * line );
130129#endif
131130
132- static void write_console (const char * line , int len );
133-
134131#ifdef WIN32
135132extern char * event_source ;
133+
136134static void write_eventlog (int level , const char * line , int len );
137135#endif
138136
@@ -149,7 +147,6 @@ static int recursion_depth = 0; /* to detect actual recursion */
149147 * Saved timeval and buffers for formatted timestamps that might be used by
150148 * both log_line_prefix and csv logs.
151149 */
152-
153150static struct timeval saved_timeval ;
154151static bool saved_timeval_set = false;
155152
@@ -169,20 +166,23 @@ static char formatted_log_time[FORMATTED_TS_LEN];
169166 } while (0)
170167
171168
169+ static const char * err_gettext (const char * str ) pg_attribute_format_arg (1 );
170+ static void set_errdata_field (MemoryContextData * cxt , char * * ptr , const char * str );
171+ static void write_console (const char * line , int len );
172+ static void setup_formatted_log_time (void );
173+ static void setup_formatted_start_time (void );
172174static const char * process_log_prefix_padding (const char * p , int * padding );
173175static void log_line_prefix (StringInfo buf , ErrorData * edata );
176+ static void write_csvlog (ErrorData * edata );
174177static void send_message_to_server_log (ErrorData * edata );
178+ static void write_pipe_chunks (char * data , int len , int dest );
175179static void send_message_to_frontend (ErrorData * edata );
176180static char * expand_fmt_string (const char * fmt , ErrorData * edata );
177181static const char * useful_strerror (int errnum );
178182static const char * get_errno_symbol (int errnum );
179183static const char * error_severity (int elevel );
180184static void append_with_tabs (StringInfo buf , const char * str );
181185static bool is_log_level_output (int elevel , int log_min_level );
182- static void write_pipe_chunks (char * data , int len , int dest );
183- static void write_csvlog (ErrorData * edata );
184- static void setup_formatted_log_time (void );
185- static void setup_formatted_start_time (void );
186186
187187
188188/*
0 commit comments