]> granicus.if.org Git - postgresql/blob - src/include/utils/elog.h
Commit to match discussed elog() changes. Only update is that LOG is
[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.31 2002/03/02 21:39:35 momjian Exp $
11  *
12  *-------------------------------------------------------------------------
13  */
14 #ifndef ELOG_H
15 #define ELOG_H
16
17 /* Error level codes */
18 #define DEBUG5  10                              /* sent only to server logs, label DEBUG */
19 #define DEBUG4  11                              /* logs in decreasing detail */
20 #define DEBUG3  12                              
21 #define DEBUG2  13                              
22 #define DEBUG1  14                              
23 #define LOG             15                              /* sent only to server logs by default, 
24                                                                  * label LOG. */
25 #define INFO    16                              /* sent only to client by default, for
26                                                                  * informative messages that are part of
27                                                                  * normal query operation. */
28 #define NOTICE  17                              /* sent to client and server by default,
29                                                                  * important messages, for unusual cases that
30                                                                  * should be reported but are not serious 
31                                                                  * enough to abort the query. */
32 #define ERROR   18                              /* user error - return to known state */
33 #define FATAL   19                              /* fatal error - abort process */
34 #define PANIC   20                              /* take down the other backends with me */
35
36 /*#define DEBUG DEBUG5*/                /* Backward compatibility with pre-7.3 */
37
38 /* Configurable parameters */
39 #ifdef ENABLE_SYSLOG
40 extern int      Use_syslog;
41 #endif
42 extern bool Log_timestamp;
43 extern bool Log_pid;
44
45 extern char        *server_min_messages_str;
46 extern char        *client_min_messages_str;
47 extern const char server_min_messages_str_default[];
48 extern const char client_min_messages_str_default[];
49
50 extern void
51 elog(int lev, const char *fmt,...)
52 /* This extension allows gcc to check the format string for consistency with
53    the supplied arguments. */
54 __attribute__((format(printf, 2, 3)));
55
56 extern int      DebugFileOpen(void);
57
58 extern bool check_server_min_messages(const char *lev);
59 extern void assign_server_min_messages(const char *lev);
60 extern bool check_client_min_messages(const char *lev);
61 extern void assign_client_min_messages(const char *lev);
62
63 #endif   /* ELOG_H */