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