mirror of
https://github.com/postgrespro/pg_probackup.git
synced 2024-12-11 11:41:33 +02:00
Remove FATAL, PANIC log levels
This commit is contained in:
parent
3f5540de6a
commit
c094151b91
@ -1663,7 +1663,7 @@ pg_stop_backup(pgBackup *backup)
|
||||
TransactionId recovery_xid;
|
||||
|
||||
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 */
|
||||
conn = (current.from_replica) ? master_conn : backup_conn;
|
||||
|
@ -107,12 +107,6 @@ write_elevel(FILE *stream, int elevel)
|
||||
case ERROR:
|
||||
fputs("ERROR: ", stream);
|
||||
break;
|
||||
case FATAL:
|
||||
fputs("FATAL: ", stream);
|
||||
break;
|
||||
case PANIC:
|
||||
fputs("PANIC: ", stream);
|
||||
break;
|
||||
default:
|
||||
elog_stderr(ERROR, "invalid logging level: %d", elevel);
|
||||
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().
|
||||
*/
|
||||
@ -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
|
||||
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
|
||||
elog_file(int elevel, const char *fmt, ...)
|
||||
@ -399,10 +393,6 @@ parse_log_level(const char *level)
|
||||
return WARNING;
|
||||
else if (pg_strncasecmp("error", v, len) == 0)
|
||||
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 */
|
||||
elog(ERROR, "invalid log-level \"%s\"", level);
|
||||
@ -431,10 +421,6 @@ deparse_log_level(int level)
|
||||
return "WARNING";
|
||||
case ERROR:
|
||||
return "ERROR";
|
||||
case FATAL:
|
||||
return "FATAL";
|
||||
case PANIC:
|
||||
return "PANIC";
|
||||
default:
|
||||
elog(ERROR, "invalid log-level %d", level);
|
||||
}
|
||||
@ -491,7 +477,7 @@ logfile_open(const char *filename, const char *mode)
|
||||
{
|
||||
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));
|
||||
errno = save_errno;
|
||||
}
|
||||
|
@ -21,8 +21,6 @@
|
||||
#define NOTICE (-2)
|
||||
#define WARNING (-1)
|
||||
#define ERROR 1
|
||||
#define FATAL 2
|
||||
#define PANIC 3
|
||||
#define LOG_OFF 10
|
||||
|
||||
/* Logger parameters */
|
||||
|
Loading…
Reference in New Issue
Block a user