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.19 2000/12/03 10:27:29 vadim Exp $
12 *-------------------------------------------------------------------------
17 #include "miscadmin.h"
19 #define NOTICE 0 /* random info - no special action */
20 #define ERROR (-1) /* user error - return to known state */
21 #define FATAL 1 /* fatal error - abort process */
22 #define REALLYFATAL 2 /* take down the other backends with me */
23 #define STOP REALLYFATAL
24 #define DEBUG (-2) /* debug message */
26 #define NOIND (-3) /* debug message, don't indent as far */
29 extern int Use_syslog;
33 * If StopIfError > 0 signal handlers don't do
34 * elog(ERROR|FATAL) but remember what action was
35 * required with QueryCancel & ExitAfterAbort
37 extern bool ExitAfterAbort;
38 #define START_CRIT_CODE StopIfError++
39 #define END_CRIT_CODE \
41 elog(STOP, "Not in critical section");\
43 if (!StopIfError && QueryCancel)\
46 elog(FATAL, "The system is shutting down");\
48 elog(ERROR, "Query was cancelled.");\
51 extern bool Log_timestamp;
55 extern void elog(int lev, const char *fmt,...);
58 /* This extension allows gcc to check the format string for consistency with
59 the supplied arguments. */
60 extern void elog(int lev, const char *fmt,...) __attribute__((format(printf, 2, 3)));
65 extern int DebugFileOpen(void);