Skip to content

Commit c094151

Browse files
committed
Remove FATAL, PANIC log levels
1 parent 3f5540d commit c094151

File tree

3 files changed

+5
-21
lines changed

3 files changed

+5
-21
lines changed

src/backup.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1663,7 +1663,7 @@ pg_stop_backup(pgBackup *backup)
16631663
TransactionId recovery_xid;
16641664

16651665
if (!backup_in_progress)
1666-
elog(FATAL, "backup is not in progress");
1666+
elog(ERROR, "backup is not in progress");
16671667

16681668
/* For replica we call pg_stop_backup() on master */
16691669
conn = (current.from_replica) ? master_conn : backup_conn;

src/utils/logger.c

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -107,12 +107,6 @@ write_elevel(FILE *stream, int elevel)
107107
case ERROR:
108108
fputs("ERROR: ", stream);
109109
break;
110-
case FATAL:
111-
fputs("FATAL: ", stream);
112-
break;
113-
case PANIC:
114-
fputs("PANIC: ", stream);
115-
break;
116110
default:
117111
elog_stderr(ERROR, "invalid logging level: %d", elevel);
118112
break;
@@ -151,7 +145,7 @@ exit_if_necessary(int elevel)
151145
}
152146

153147
/*
154-
* Logs to stderr or to log file and exit if ERROR or FATAL.
148+
* Logs to stderr or to log file and exit if ERROR.
155149
*
156150
* Actual implementation for elog() and pg_log().
157151
*/
@@ -288,7 +282,7 @@ elog_stderr(int elevel, const char *fmt, ...)
288282
}
289283

290284
/*
291-
* Logs to stderr or to log file and exit if ERROR or FATAL.
285+
* Logs to stderr or to log file and exit if ERROR.
292286
*/
293287
void
294288
elog(int elevel, const char *fmt, ...)
@@ -308,7 +302,7 @@ elog(int elevel, const char *fmt, ...)
308302
}
309303

310304
/*
311-
* Logs only to log file and exit if ERROR or FATAL.
305+
* Logs only to log file and exit if ERROR.
312306
*/
313307
void
314308
elog_file(int elevel, const char *fmt, ...)
@@ -399,10 +393,6 @@ parse_log_level(const char *level)
399393
return WARNING;
400394
else if (pg_strncasecmp("error", v, len) == 0)
401395
return ERROR;
402-
else if (pg_strncasecmp("fatal", v, len) == 0)
403-
return FATAL;
404-
else if (pg_strncasecmp("panic", v, len) == 0)
405-
return PANIC;
406396

407397
/* Log level is invalid */
408398
elog(ERROR, "invalid log-level \"%s\"", level);
@@ -431,10 +421,6 @@ deparse_log_level(int level)
431421
return "WARNING";
432422
case ERROR:
433423
return "ERROR";
434-
case FATAL:
435-
return "FATAL";
436-
case PANIC:
437-
return "PANIC";
438424
default:
439425
elog(ERROR, "invalid log-level %d", level);
440426
}
@@ -491,7 +477,7 @@ logfile_open(const char *filename, const char *mode)
491477
{
492478
int save_errno = errno;
493479

494-
elog_stderr(FATAL, "could not open log file \"%s\": %s",
480+
elog_stderr(ERROR, "could not open log file \"%s\": %s",
495481
filename, strerror(errno));
496482
errno = save_errno;
497483
}

src/utils/logger.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@
2121
#define NOTICE (-2)
2222
#define WARNING (-1)
2323
#define ERROR 1
24-
#define FATAL 2
25-
#define PANIC 3
2624
#define LOG_OFF 10
2725

2826
/* Logger parameters */

0 commit comments

Comments
 (0)