2017-04-25 18:44:49 +02:00
|
|
|
/*-------------------------------------------------------------------------
|
|
|
|
*
|
|
|
|
* logger.h: - prototypes of logger functions.
|
|
|
|
*
|
|
|
|
* Portions Copyright (c) 2017-2017, Postgres Professional
|
|
|
|
*
|
|
|
|
*-------------------------------------------------------------------------
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef LOGGER_H
|
|
|
|
#define LOGGER_H
|
|
|
|
|
2017-04-26 16:42:12 +02:00
|
|
|
#include "postgres_fe.h"
|
|
|
|
|
2017-04-25 18:44:49 +02:00
|
|
|
/* Log level */
|
|
|
|
#define VERBOSE (-5)
|
|
|
|
#define LOG (-4)
|
|
|
|
#define INFO (-3)
|
|
|
|
#define NOTICE (-2)
|
|
|
|
#define WARNING (-1)
|
|
|
|
#define ERROR 1
|
|
|
|
#define FATAL 2
|
|
|
|
#define PANIC 3
|
|
|
|
|
|
|
|
/* Logger parameters */
|
|
|
|
|
|
|
|
extern int log_level;
|
2017-05-18 11:07:45 +02:00
|
|
|
extern bool log_level_defined;
|
2017-04-25 18:44:49 +02:00
|
|
|
|
|
|
|
extern char *log_filename;
|
2017-04-26 16:00:06 +02:00
|
|
|
extern char *error_log_filename;
|
2017-04-25 18:44:49 +02:00
|
|
|
extern char *log_directory;
|
2017-04-26 16:42:12 +02:00
|
|
|
extern char log_path[MAXPGPATH];
|
2017-04-25 18:44:49 +02:00
|
|
|
|
|
|
|
extern int log_rotation_size;
|
|
|
|
extern int log_rotation_age;
|
|
|
|
|
|
|
|
#undef elog
|
|
|
|
extern void elog(int elevel, const char *fmt, ...) pg_attribute_printf(2, 3);
|
|
|
|
|
2017-04-27 13:09:44 +02:00
|
|
|
extern int parse_log_level(const char *level);
|
2017-05-18 11:07:45 +02:00
|
|
|
extern const char *deparse_log_level(int level);
|
2017-04-27 13:09:44 +02:00
|
|
|
|
2017-04-25 18:44:49 +02:00
|
|
|
#endif /* LOGGER_H */
|