1
0
mirror of https://github.com/postgrespro/pg_probackup.git synced 2024-12-12 11:45:24 +02:00

Remove FATAL, PANIC log levels

This commit is contained in:
Arthur Zakirov 2018-08-07 13:28:02 +03:00
parent 3f5540de6a
commit c094151b91
3 changed files with 5 additions and 21 deletions

View File

@ -1663,7 +1663,7 @@ pg_stop_backup(pgBackup *backup)
TransactionId recovery_xid; TransactionId recovery_xid;
if (!backup_in_progress) if (!backup_in_progress)
elog(FATAL, "backup is not in progress"); elog(ERROR, "backup is not in progress");
/* For replica we call pg_stop_backup() on master */ /* For replica we call pg_stop_backup() on master */
conn = (current.from_replica) ? master_conn : backup_conn; conn = (current.from_replica) ? master_conn : backup_conn;

View File

@ -107,12 +107,6 @@ write_elevel(FILE *stream, int elevel)
case ERROR: case ERROR:
fputs("ERROR: ", stream); fputs("ERROR: ", stream);
break; break;
case FATAL:
fputs("FATAL: ", stream);
break;
case PANIC:
fputs("PANIC: ", stream);
break;
default: default:
elog_stderr(ERROR, "invalid logging level: %d", elevel); elog_stderr(ERROR, "invalid logging level: %d", elevel);
break; break;
@ -151,7 +145,7 @@ exit_if_necessary(int elevel)
} }
/* /*
* Logs to stderr or to log file and exit if ERROR or FATAL. * Logs to stderr or to log file and exit if ERROR.
* *
* Actual implementation for elog() and pg_log(). * Actual implementation for elog() and pg_log().
*/ */
@ -288,7 +282,7 @@ elog_stderr(int elevel, const char *fmt, ...)
} }
/* /*
* Logs to stderr or to log file and exit if ERROR or FATAL. * Logs to stderr or to log file and exit if ERROR.
*/ */
void void
elog(int elevel, const char *fmt, ...) elog(int elevel, const char *fmt, ...)
@ -308,7 +302,7 @@ elog(int elevel, const char *fmt, ...)
} }
/* /*
* Logs only to log file and exit if ERROR or FATAL. * Logs only to log file and exit if ERROR.
*/ */
void void
elog_file(int elevel, const char *fmt, ...) elog_file(int elevel, const char *fmt, ...)
@ -399,10 +393,6 @@ parse_log_level(const char *level)
return WARNING; return WARNING;
else if (pg_strncasecmp("error", v, len) == 0) else if (pg_strncasecmp("error", v, len) == 0)
return ERROR; return ERROR;
else if (pg_strncasecmp("fatal", v, len) == 0)
return FATAL;
else if (pg_strncasecmp("panic", v, len) == 0)
return PANIC;
/* Log level is invalid */ /* Log level is invalid */
elog(ERROR, "invalid log-level \"%s\"", level); elog(ERROR, "invalid log-level \"%s\"", level);
@ -431,10 +421,6 @@ deparse_log_level(int level)
return "WARNING"; return "WARNING";
case ERROR: case ERROR:
return "ERROR"; return "ERROR";
case FATAL:
return "FATAL";
case PANIC:
return "PANIC";
default: default:
elog(ERROR, "invalid log-level %d", level); elog(ERROR, "invalid log-level %d", level);
} }
@ -491,7 +477,7 @@ logfile_open(const char *filename, const char *mode)
{ {
int save_errno = errno; int save_errno = errno;
elog_stderr(FATAL, "could not open log file \"%s\": %s", elog_stderr(ERROR, "could not open log file \"%s\": %s",
filename, strerror(errno)); filename, strerror(errno));
errno = save_errno; errno = save_errno;
} }

View File

@ -21,8 +21,6 @@
#define NOTICE (-2) #define NOTICE (-2)
#define WARNING (-1) #define WARNING (-1)
#define ERROR 1 #define ERROR 1
#define FATAL 2
#define PANIC 3
#define LOG_OFF 10 #define LOG_OFF 10
/* Logger parameters */ /* Logger parameters */