]> granicus.if.org Git - postgresql/blob - src/include/utils/elog.h
Preliminary code cleanup in elog(). Split out some code into utility
[postgresql] / src / include / utils / elog.h
1 /*-------------------------------------------------------------------------
2  *
3  * elog.h
4  *        POSTGRES error logging definitions.
5  *
6  *
7  * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
8  * Portions Copyright (c) 1994, Regents of the University of California
9  *
10  * $Id: elog.h,v 1.27 2001/06/08 21:16:49 petere Exp $
11  *
12  *-------------------------------------------------------------------------
13  */
14 #ifndef ELOG_H
15 #define ELOG_H
16
17 /* Error level codes */
18 #define NOTICE  0                               /* random info, sent to frontend */
19 #define ERROR   (-1)                    /* user error - return to known state */
20 #define FATAL   1                               /* fatal error - abort process */
21 #define REALLYFATAL 2                   /* take down the other backends with me */
22 #define DEBUG   (-2)                    /* debug message */
23
24 /* temporary nonsense... */
25 #define STOP    REALLYFATAL
26 #define LOG             DEBUG
27
28 /* Configurable parameters */
29 #ifdef ENABLE_SYSLOG
30 extern int      Use_syslog;
31 #endif
32 extern bool Log_timestamp;
33 extern bool Log_pid;
34
35
36 extern void elog(int lev, const char *fmt,...)
37 /* This extension allows gcc to check the format string for consistency with
38    the supplied arguments. */
39 __attribute__((format(printf, 2, 3)));
40
41 extern int      DebugFileOpen(void);
42
43 #endif   /* ELOG_H */