1 /*-------------------------------------------------------------------------
4 * POSTGRES error logging definitions.
7 * Portions Copyright (c) 1996-2000, PostgreSQL, Inc
8 * Portions Copyright (c) 1994, Regents of the University of California
10 * $Id: elog.h,v 1.20 2000/12/06 17:25:45 tgl Exp $
12 *-------------------------------------------------------------------------
17 #define NOTICE 0 /* random info - no special action */
18 #define ERROR (-1) /* user error - return to known state */
19 #define FATAL 1 /* fatal error - abort process */
20 #define REALLYFATAL 2 /* take down the other backends with me */
21 #define STOP REALLYFATAL
22 #define DEBUG (-2) /* debug message */
24 #define NOIND (-3) /* debug message, don't indent as far */
27 extern int Use_syslog;
31 * If StopIfError > 0 signal handlers mustn't do
32 * elog(ERROR|FATAL), instead remember what action is
33 * required with QueryCancel & ExitAfterAbort.
35 extern uint32 StopIfError; /* duplicates access/xlog.h */
36 extern bool QueryCancel; /* duplicates miscadmin.h */
37 extern bool ExitAfterAbort;
39 #define START_CRIT_CODE (StopIfError++)
41 #define END_CRIT_CODE \
44 elog(STOP, "Not in critical section"); \
46 if (!StopIfError && QueryCancel) \
49 elog(FATAL, "The system is shutting down"); \
51 elog(ERROR, "Query was cancelled."); \
55 extern bool Log_timestamp;
59 extern void elog(int lev, const char *fmt,...);
62 /* This extension allows gcc to check the format string for consistency with
63 the supplied arguments. */
64 extern void elog(int lev, const char *fmt,...) __attribute__((format(printf, 2, 3)));
69 extern int DebugFileOpen(void);