bool Log_truncate_on_rotation = false;
int Log_file_mode = S_IRUSR | S_IWUSR;
-/*
- * Globally visible state (used by elog.c)
- */
-bool am_syslogger = false;
-
extern bool redirection_done;
/*
syslogger_parseArgs(argc, argv);
#endif /* EXEC_BACKEND */
- am_syslogger = true;
-
MyBackendType = B_LOGGER;
init_ps_display(NULL);
/*
* Write text to the currently open logfile
*
- * This is exported so that elog.c can call it when am_syslogger is true.
+ * This is exported so that elog.c can call it when MyBackendType is B_LOGGER.
* This allows the syslogger process to record elog messages of its own,
* even though its stderr does not point at the syslog pipe.
*/
appendStringInfoChar(&buf, '\n');
/* If in the syslogger process, try to write messages direct to file */
- if (am_syslogger)
+ if (MyBackendType == B_LOGGER)
write_syslogger_file(buf.data, buf.len, LOG_DESTINATION_CSVLOG);
else
write_pipe_chunks(buf.data, buf.len, LOG_DESTINATION_CSVLOG);
* catching stderr output, and we are not ourselves the syslogger.
* Otherwise, just do a vanilla write to stderr.
*/
- if (redirection_done && !am_syslogger)
+ if (redirection_done && MyBackendType != B_LOGGER)
write_pipe_chunks(buf.data, buf.len, LOG_DESTINATION_STDERR);
#ifdef WIN32
}
/* If in the syslogger process, try to write messages direct to file */
- if (am_syslogger)
+ if (MyBackendType == B_LOGGER)
write_syslogger_file(buf.data, buf.len, LOG_DESTINATION_STDERR);
/* Write to CSV log if enabled */
if (Log_destination & LOG_DESTINATION_CSVLOG)
{
- if (redirection_done || am_syslogger)
+ if (redirection_done || MyBackendType == B_LOGGER)
{
/*
* send CSV data if it's safe to do so (syslogger doesn't need the