@@ -190,14 +190,14 @@ elog_internal(int elevel, bool file_only, const char *fmt, va_list args)
190
190
loggin_in_progress = true;
191
191
192
192
/* We need copy args only if we need write to error log file */
193
- if (write_to_error_log )
194
- va_copy (error_args , args );
193
+ // if (write_to_error_log)
194
+ // va_copy(error_args, args);
195
195
/*
196
196
* We need copy args only if we need write to stderr. But do not copy args
197
197
* if we need to log only to stderr.
198
198
*/
199
- if (write_to_stderr && write_to_file )
200
- va_copy (std_args , args );
199
+ // if (write_to_stderr && write_to_file)
200
+ // va_copy(std_args, args);
201
201
202
202
if (write_to_file || write_to_error_log )
203
203
strftime (strfbuf , sizeof (strfbuf ), "%Y-%m-%d %H:%M:%S %Z" ,
@@ -238,7 +238,8 @@ elog_internal(int elevel, bool file_only, const char *fmt, va_list args)
238
238
239
239
fprintf (error_log_file , "%s: " , strfbuf );
240
240
write_elevel (error_log_file , elevel );
241
-
241
+
242
+ va_copy (error_args , args );
242
243
vfprintf (error_log_file , fmt , error_args );
243
244
fputc ('\n' , error_log_file );
244
245
fflush (error_log_file );
@@ -253,7 +254,7 @@ elog_internal(int elevel, bool file_only, const char *fmt, va_list args)
253
254
if (write_to_stderr )
254
255
{
255
256
write_elevel (stderr , elevel );
256
-
257
+ va_copy ( std_args , args );
257
258
if (write_to_file )
258
259
vfprintf (stderr , fmt , std_args );
259
260
else
0 commit comments