#include <stdio.h>
#include <yaz/yconfig.h>
Go to the source code of this file.
Defines | |
| #define | YLOG_FATAL 0x00000001 |
| log level: fatal | |
| #define | YLOG_DEBUG 0x00000002 |
| log level: debugging | |
| #define | YLOG_WARN 0x00000004 |
| log level: warning | |
| #define | YLOG_LOG 0x00000008 |
| log level: log (regular) | |
| #define | YLOG_ERRNO 0x00000010 |
| log level: append system error message | |
| #define | YLOG_APP 0x00000040 |
| log level: application | |
| #define | YLOG_MALLOC 0x00000080 |
| log level: malloc debug | |
| #define | YLOG_NOTIME 0x00000100 |
| log level: do not output date and time | |
| #define | YLOG_APP2 0x00000200 |
| log level: application 2 | |
| #define | YLOG_APP3 0x00000400 |
| log level: application 3 | |
| #define | YLOG_FLUSH 0x00000800 |
| log level: flush | |
| #define | YLOG_LOGLVL 0x00001000 |
| dynamic log level start | |
| #define | YLOG_ALL (0xffff&~YLOG_MALLOC&~YLOG_NOTIME) |
| #define | YLOG_DEFAULT_LEVEL (YLOG_FATAL | YLOG_ERRNO | YLOG_LOG | YLOG_WARN | YLOG_FLUSH) |
| default log level | |
| #define | YLOG_LAST_BIT YLOG_LOGLVL |
| last bit for regular log bits . Rest are dynamic | |
| #define | YAZ_USE_NEW_LOG 1 |
Functions | |
| void | yaz_log_init (int level, const char *prefix, const char *fname) |
| sets level, prefix and filename for logging | |
| void | yaz_log_init_file (const char *fname) |
| sets log to a file | |
| void | yaz_log_init_level (int level) |
| sets log level | |
| void | yaz_log_init_prefix (const char *prefix) |
| sets log message prefix | |
| void | yaz_log_init_prefix2 (const char *prefix) |
| sets second log message prefix | |
| void | yaz_log_time_format (const char *fmt) |
| sets time format for log mesages | |
| void | yaz_log_init_max_size (int mx) |
| sets limit in bytes for size for log file | |
| void | yaz_log (int level, const char *fmt,...) |
| Writes log message. | |
| int | yaz_log_mask_str (const char *str) |
| converts log level string to log level (integer) | |
| 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 | |
| FILE * | yaz_log_file (void) |
| returns FILE handle for log or NULL if no file is in use | |
| void | yaz_log_set_handler (void(*func)(int, const char *, void *), void *info) |
| sets custom log handler | |
| void | yaz_log_reopen (void) |
| void | yaz_log_trunc (void) |
| Truncate the log file. | |
| void | log_event_start (void(*func)(int level, const char *msg, void *info), void *info) |
| void | log_event_end (void(*func)(int level, const char *msg, void *info), void *info) |
| void | yaz_log_xml_errors (const char *prefix, int log_level) |
| Makes Libxml2/Libxslt log errors via yaz_log. | |
Definition in file log.h.
| #define YLOG_DEBUG 0x00000002 |
log level: debugging
Definition at line 44 of file log.h.
Referenced by backend_response(), check_ip_tcpd(), control_association(), ir_read(), and ir_session().
| #define YLOG_DEFAULT_LEVEL (YLOG_FATAL | YLOG_ERRNO | YLOG_LOG | YLOG_WARN | YLOG_FLUSH) |
| #define YLOG_ERRNO 0x00000010 |
log level: append system error message
Definition at line 50 of file log.h.
Referenced by create_association(), readconf(), xrealloc_f(), yaz_daemon(), yaz_log(), and yaz_sc_program().
| #define YLOG_FATAL 0x00000001 |
log level: fatal
Definition at line 42 of file log.h.
Referenced by backend_response(), nmem_malloc(), xcalloc_f(), xmalloc_f(), xrealloc_f(), yaz_daemon(), and yaz_sc_program().
| #define YLOG_FLUSH 0x00000800 |
| #define YLOG_LAST_BIT YLOG_LOGLVL |
last bit for regular log bits . Rest are dynamic
Definition at line 76 of file log.h.
Referenced by yaz_log_init_level().
| #define YLOG_LOG 0x00000008 |
log level: log (regular)
Definition at line 48 of file log.h.
Referenced by completeBER(), completeBER_n(), log_rpn_query(), log_scan_term(), yaz_check_print1(), yaz_log_zquery(), yaz_sc_program(), z_External(), ZOOM_connection_show_task(), ZOOM_connection_show_tasks(), and ztest_search().
| #define YLOG_LOGLVL 0x00001000 |
dynamic log level start
Definition at line 64 of file log.h.
Referenced by yaz_log_init_level(), and yaz_log_module_level().
| #define YLOG_NOTIME 0x00000100 |
| #define YLOG_WARN 0x00000004 |
log level: warning
Definition at line 46 of file log.h.
Referenced by backend_response(), bend_backend_respond(), ccl_qual_field(), check_options(), create_association(), ir_read(), ir_session(), and readconf().
| void log_event_end | ( | void(*)(int level, const char *msg, void *info) | func, | |
| void * | info | |||
| ) |
| void log_event_start | ( | void(*)(int level, const char *msg, void *info) | func, | |
| void * | info | |||
| ) |
| void yaz_log | ( | int | level, | |
| const char * | fmt, | |||
| ... | ||||
| ) |
Writes log message.
| level | log level mask | |
| fmt | format string ala printf |
Definition at line 430 of file log.c.
References yaz_log_file(), yaz_strerror(), yaz_vsnprintf(), and YLOG_ERRNO.
Referenced by backend_response(), bend_backend_respond(), ccl_qual_field(), check_ip_tcpd(), completeBER(), completeBER_n(), control_association(), create_association(), iochan_event_loop(), ir_read(), ir_session(), log_scan_term_level(), nmem_malloc(), nmem_reset(), odr_createmem(), odr_destroy(), odr_reset(), readconf(), xcalloc_f(), xfree_f(), xmalloc_f(), xrealloc_f(), xstrdup_f(), yaz_check_print1(), yaz_daemon(), yaz_log_init_level(), yaz_log_module_level(), yaz_log_zquery_level(), yaz_sc_program(), z_External(), ZOOM_connection_connect(), ZOOM_connection_create(), ZOOM_connection_destroy(), ZOOM_connection_search(), ZOOM_connection_show_task(), ZOOM_connection_show_tasks(), ZOOM_event_nonblock(), ZOOM_query_cql(), ZOOM_query_cql2rpn(), ZOOM_query_create(), ZOOM_query_destroy(), ZOOM_query_prefix(), ZOOM_query_sortby(), ZOOM_resultset_addref(), ZOOM_resultset_create(), ZOOM_resultset_records(), ZOOM_resultset_size(), ZOOM_resultset_sort1(), ztest_esrequest(), and ztest_search().
| FILE* yaz_log_file | ( | void | ) |
returns FILE handle for log or NULL if no file is in use
| FILE | FILE handle in use | |
| NULL | log is currently not written to a file |
Definition at line 120 of file log.c.
References use_file, use_none, and use_stderr.
Referenced by create_association(), ir_read(), yaz_log(), and ztest_esrequest().
| void yaz_log_init | ( | int | level, | |
| const char * | prefix, | |||
| const char * | fname | |||
| ) |
sets level, prefix and filename for logging
| level | log level | |
| prefix | log message prefix | |
| fname | filename |
Definition at line 252 of file log.c.
References yaz_log_init_file(), yaz_log_init_level(), and yaz_log_init_prefix().
| void yaz_log_init_file | ( | const char * | fname | ) |
sets log to a file
| fname | filename |
Definition at line 141 of file log.c.
References use_file, use_none, use_stderr, yaz_log_close(), and yaz_log_reopen().
Referenced by check_options(), yaz_check_init_log(), and yaz_log_init().
| void yaz_log_init_level | ( | int | level | ) |
sets log level
| level | (combination of YLOG_..) |
Definition at line 201 of file log.c.
References mask, name, yaz_log(), yaz_log_reopen(), YLOG_FLUSH, YLOG_LAST_BIT, and YLOG_LOGLVL.
Referenced by check_options(), and yaz_log_init().
| void yaz_log_init_max_size | ( | int | mx | ) |
sets limit in bytes for size for log file
| mx | size in bytes |
Definition at line 261 of file log.c.
Referenced by check_options().
| void yaz_log_init_prefix | ( | const char * | prefix | ) |
sets log message prefix
| prefix | log message prefix |
Definition at line 236 of file log.c.
References yaz_snprintf().
Referenced by yaz_log_init().
| void yaz_log_init_prefix2 | ( | const char * | prefix | ) |
sets second log message prefix
| prefix | log message prefix |
Definition at line 244 of file log.c.
References yaz_snprintf().
| int yaz_log_mask_str | ( | const char * | str | ) |
converts log level string to log level (integer)
| str | log level string |
Definition at line 546 of file log.c.
References yaz_log_mask_str_x().
Referenced by check_options().
| int yaz_log_mask_str_x | ( | const char * | str, | |
| int | level | |||
| ) |
converts log level string to log level with "start" level
| str | log level string | |
| level | initialing log level |
Definition at line 552 of file log.c.
References mask.
Referenced by yaz_log_mask_str().
| int yaz_log_module_level | ( | const char * | name | ) |
returns level for module
| name | module name |
Definition at line 526 of file log.c.
References mask, yaz_log(), and YLOG_LOGLVL.
Referenced by bend_init(), iochan_create(), nmem_create(), odr_createmem(), odr_reset(), xcalloc_f(), xmalloc_f(), xmalloc_trav_f(), xrealloc_f(), xstrdup_f(), and yaz_strerror().
| void yaz_log_reopen | ( | void | ) |
| void yaz_log_set_handler | ( | void(*)(int, const char *, void *) | func, | |
| void * | info | |||
| ) |
| void yaz_log_time_format | ( | const char * | fmt | ) |
sets time format for log mesages
| fmt | format (strftime) |
Definition at line 469 of file log.c.
References TIMEFORMAT_LEN.
Referenced by check_options().
| void yaz_log_trunc | ( | void | ) |
| void yaz_log_xml_errors | ( | const char * | prefix, | |
| int | log_level | |||
| ) |
Makes Libxml2/Libxslt log errors via yaz_log.
| prefix | prefix to use for log messages (may be 0) | |
| log_level | log level to use for messages |
Definition at line 42 of file xmlerror.c.
Referenced by check_options().
1.5.6