1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-03 09:13:20 +03:00

Remove am_syslogger global variable

Use the new MyBackendType instead.  More similar changes for other "am
something" variables are possible.  This one was just particularly
simple.

Reviewed-by: Julien Rouhaud <rjuju123@gmail.com>
Reviewed-by: Kuntal Ghosh <kuntalghosh.2007@gmail.com>
Reviewed-by: Alvaro Herrera <alvherre@2ndquadrant.com>
Discussion: https://www.postgresql.org/message-id/flat/c65e5196-4f04-4ead-9353-6088c19615a3@2ndquadrant.com
This commit is contained in:
Peter Eisentraut
2020-03-11 16:36:40 +01:00
parent 8e8a0becb3
commit d90bd24391
3 changed files with 5 additions and 14 deletions

View File

@@ -2923,7 +2923,7 @@ write_csvlog(ErrorData *edata)
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);
@@ -3117,7 +3117,7 @@ send_message_to_server_log(ErrorData *edata)
* 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
@@ -3136,13 +3136,13 @@ send_message_to_server_log(ErrorData *edata)
}
/* 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