From 08eb8faf0366e6e0814ecd80ddd0ce6392424a52 Mon Sep 17 00:00:00 2001 From: Adam Dickmeiss Date: Sun, 21 Nov 2004 21:55:15 +0000 Subject: [PATCH] Update log chapter for new log system --- doc/tools.xml | 33 ++++++++++++++++++--------------- 1 file changed, 18 insertions(+), 15 deletions(-) diff --git a/doc/tools.xml b/doc/tools.xml index 01fb2c5..add24b4 100644 --- a/doc/tools.xml +++ b/doc/tools.xml @@ -1,4 +1,4 @@ - + Supporting Tools @@ -1798,14 +1798,17 @@ typedef struct oident Log - Yaz has evolved a fairly complex log system which should be useful both - for debugging &yaz; itself, debugging applications that use yaz, and for + &yaz; has evolved a fairly complex log system which should be useful both + for debugging &yaz; itself, debugging applications that use &yaz;, and for production use of those applications. - The log functions are declared in log.h and - implemented in log.c. The key points of the interface - are: + The log functions are declared in header yaz/ylog.h + and implemented in src/log.c. + Due to name clash with syslog and some math utilities the logging + interface has been modified as of YAZ 2.0.29. The obsolete interface + is still available if the application includes + yaz/log.h. The key points of the interface are: void yaz_log(int level, const char *fmt, ...) @@ -1831,15 +1834,15 @@ typedef struct oident The log level is a bit mask, that says on which level(s) the log entry should be made, and optionally set some behaviour of the - logging. In the most simple cases, it can be one of LOG_FATAL, - LOG_DEBUG, LOG_WARN, LOG_LOG. Those can be combined with bits - that modify the way the log entry is written:LOG_ERRNO, LOG_NOTIME, - LOG_FLUSH. Most of the rest of the bits are deprecated, and - should not be used. + logging. In the most simple cases, it can be one of YLOG_FATAL, + YLOG_DEBUG, YLOG_WARN, YLOG_LOG. Those can be combined with bits + that modify the way the log entry is written:YLOG_ERRNO, + YLOG_NOTIME, YLOG_FLUSH. + Most of the rest of the bits are deprecated, and should not be used. - Applications that use yaz, should not use the LOG_LOG for ordinary + Applications that use &yaz;, should not use the LOG_LOG for ordinary messages, but should make use of the dynamic loglevel system. This consists of two parts, defining the loglevel and checking it. @@ -1849,7 +1852,7 @@ typedef struct oident yaz_log_mask_str to define which log levels are to be logged. This string should be a comma-separated list of log level names, and can contain both hard-coded names and dynamic ones. The log level - calculation starts with LOG_DEFAULT_LEVEL and adds a bit + calculation starts with YLOG_DEFAULT_LEVEL and adds a bit for each word it meets, unless the word starts with a '-', in which case it clears the bit. If the string 'none' is found, all bits are cleared. Typically this string comes from the command-line, @@ -1883,7 +1886,7 @@ typedef struct oident The log entries start with a time stamp. This can be omitted by setting the - LOG_NOTIME bit in the loglevel. This way automatic tests + YLOG_NOTIME bit in the loglevel. This way automatic tests can be hoped to produce identical log files, that are easy to diff. The format of the time stamp can be set with yaz_log_time_format, which takes a format string just @@ -1899,7 +1902,7 @@ typedef struct oident - The log level LOG_LOGLVL, enabled by the string + The log level YLOG_LOGLVL, enabled by the string loglevel, will log all the log-level affecting operations. This can come in handy if you need to know what other log levels would be useful. Grep the logfile for [loglevel]. -- 1.7.10.4