10 #ifndef COMMON_LOGGING_H
11 #define COMMON_LOGGING_H
86 #define PG_LOG_FLAG_TERSE 1
96 const char *pg_restrict
fmt,...)
99 const
char *pg_restrict
fmt, va_list ap)
106 #define pg_log_error(...) \
107 pg_log_generic(PG_LOG_ERROR, PG_LOG_PRIMARY, __VA_ARGS__)
109 #define pg_log_error_detail(...) \
110 pg_log_generic(PG_LOG_ERROR, PG_LOG_DETAIL, __VA_ARGS__)
112 #define pg_log_error_hint(...) \
113 pg_log_generic(PG_LOG_ERROR, PG_LOG_HINT, __VA_ARGS__)
115 #define pg_log_warning(...) \
116 pg_log_generic(PG_LOG_WARNING, PG_LOG_PRIMARY, __VA_ARGS__)
118 #define pg_log_warning_detail(...) \
119 pg_log_generic(PG_LOG_WARNING, PG_LOG_DETAIL, __VA_ARGS__)
121 #define pg_log_warning_hint(...) \
122 pg_log_generic(PG_LOG_WARNING, PG_LOG_HINT, __VA_ARGS__)
124 #define pg_log_info(...) \
125 pg_log_generic(PG_LOG_INFO, PG_LOG_PRIMARY, __VA_ARGS__)
127 #define pg_log_info_detail(...) \
128 pg_log_generic(PG_LOG_INFO, PG_LOG_DETAIL, __VA_ARGS__)
130 #define pg_log_info_hint(...) \
131 pg_log_generic(PG_LOG_INFO, PG_LOG_HINT, __VA_ARGS__)
133 #define pg_log_debug(...) do { \
134 if (unlikely(__pg_log_level <= PG_LOG_DEBUG)) \
135 pg_log_generic(PG_LOG_DEBUG, PG_LOG_PRIMARY, __VA_ARGS__); \
138 #define pg_log_debug_detail(...) do { \
139 if (unlikely(__pg_log_level <= PG_LOG_DEBUG)) \
140 pg_log_generic(PG_LOG_DEBUG, PG_LOG_DETAIL, __VA_ARGS__); \
143 #define pg_log_debug_hint(...) do { \
144 if (unlikely(__pg_log_level <= PG_LOG_DEBUG)) \
145 pg_log_generic(PG_LOG_DEBUG, PG_LOG_HINT, __VA_ARGS__); \
151 #define pg_fatal(...) do { \
152 pg_log_generic(PG_LOG_ERROR, PG_LOG_PRIMARY, __VA_ARGS__); \
#define pg_attribute_printf(f, a)
static void const char * fmt
void pg_logging_increase_verbosity(void)
void pg_logging_init(const char *argv0)
void pg_logging_set_locus_callback(void(*cb)(const char **filename, uint64 *lineno))
void pg_logging_config(int new_flags)
void pg_logging_set_level(enum pg_log_level new_level)
void pg_log_generic(enum pg_log_level level, enum pg_log_part part, const char *pg_restrict fmt,...) pg_attribute_printf(3
void pg_logging_set_pre_callback(void(*cb)(void))
enum pg_log_level __pg_log_level
void void pg_log_generic_v(enum pg_log_level level, enum pg_log_part part, const char *pg_restrict fmt, va_list ap) pg_attribute_printf(3