42 #define YLOG_FATAL 0x00000001
44 #define YLOG_DEBUG 0x00000002
46 #define YLOG_WARN 0x00000004
48 #define YLOG_LOG 0x00000008
50 #define YLOG_ERRNO 0x00000010
52 #define YLOG_TID 0x00000020
54 #define YLOG_APP 0x00000040
56 #define YLOG_MALLOC 0x00000080
58 #define YLOG_NOTIME 0x00000100
60 #define YLOG_APP2 0x00000200
62 #define YLOG_APP3 0x00000400
64 #define YLOG_FLUSH 0x00000800
66 #define YLOG_LOGLVL 0x00001000
69 #define YLOG_ALL (0xffff&~YLOG_MALLOC&~YLOG_NOTIME)
72 #define YLOG_DEFAULT_LEVEL \
73 (YLOG_FATAL | YLOG_ERRNO | YLOG_LOG | YLOG_WARN | YLOG_FLUSH)
78 #define YLOG_LAST_BIT YLOG_LOGLVL
87 YAZ_EXPORT
void yaz_log_init(
int level,
const char *prefix,
const char *fname);
140 YAZ_EXPORT
void yaz_log(
int level,
const char *fmt, ...)
142 __attribute__ ((format (printf, 2, 3)))
194 void *),
void *info);
208 void *info),
void *info);
215 void *info),
void *info);
void yaz_log_set_handler(void(*func)(int, const char *, void *), void *info)
sets custom log handler
FILE * yaz_log_file(void)
returns FILE handle for log or NULL if no file is in use
void yaz_log_init_prefix(const char *prefix)
sets log message prefix
int yaz_log_mask_str(const char *str)
converts log level string to log level (integer)
void yaz_log_init_max_size(int mx)
sets limit in bytes for size for log file
void yaz_log_reopen(void)
reopen current log file (unless disabled or stderr)
void yaz_log_trunc(void)
Truncate the log file.
void yaz_log_init_prefix2(const char *prefix)
sets second log message prefix
void yaz_log_init_level(int level)
sets log level
void log_event_start(void(*func)(int level, const char *msg, void *info), void *info)
installs hook to be called before each log msg
void yaz_log_init(int level, const char *prefix, const char *fname)
sets level, prefix and filename for logging
void yaz_log_xml_errors(const char *prefix, int log_level)
Makes Libxml2 and Libxslt log errors through yaz_log.
void yaz_log_lock(void)
Lock for YAZ log writes.
void yaz_log_time_format(const char *fmt)
sets time format for log mesages
void log_event_end(void(*func)(int level, const char *msg, void *info), void *info)
installs hook to be called after each log msg
void yaz_log(int level, const char *fmt,...)
Writes log message.
void yaz_log_init_file(const char *fname)
sets log file
void yaz_log_unlock(void)
Unlock for YAZ log writes.
int yaz_log_mask_str_x(const char *str, int level)
converts log level string to log level with "start" level
int yaz_log_module_level(const char *name)
returns level for module
Header with fundamental macros.