#include <stdarg.h>
#include <sofia-sip/su_config.h>
Include dependency graph for su_log.h:

Go to the source code of this file.
Data Structures | |
| struct | su_log_s |
| Log object. More... | |
Defines | |
| #define | SU_LOG_INIT(name, env, level) |
| Initialize a su_log_t structure. | |
Typedefs | |
| typedef su_log_s | su_log_t |
| Type of log structure. | |
Functions | |
|
SOFIA_BEGIN_DECLS typedef void() | su_logger_f (void *stream, char const *fmt, va_list ap) |
| Prototype for logging function. | |
| SOFIAPUBFUN void | su_log (char const *fmt,...))) |
| Log a message to default log. | |
| SOFIAPUBFUN void | su_llog (su_log_t *log, unsigned level, char const *fmt,...))) |
| Log a message with level. | |
| SOFIAPUBFUN void | su_vllog (su_log_t *log, unsigned level, char const *fmt, va_list ap) |
| Log a message with level (stdarg version). | |
| SOFIAPUBFUN void | su_log_redirect (su_log_t *log, su_logger_f *f, void *stream) |
| Redirect a log. | |
| SOFIAPUBFUN void | su_log_set_level (su_log_t *log, unsigned level) |
| Set log level. | |
| SOFIAPUBFUN void | su_log_soft_set_level (su_log_t *log, unsigned level) |
| Set log level. | |
| SOFIAPUBFUN void | su_log_init (su_log_t *log) |
| Initialize a log. | |
| SOFIAPUBFUN void | su_perror (char const *s) |
| Log the latest su error message. | |
| SOFIAPUBFUN void | su_perror2 (char const *s, int errcode) |
| Log the su error message. | |
| SOFIAPUBFUN void su_llog | ( | su_log_t * | log, | |
| unsigned | level, | |||
| char const * | fmt, | |||
| ... | ||||
| ) |
Log a message with level.
| SOFIAPUBFUN void su_log | ( | char const * | fmt, | |
| ... | ||||
| ) |
Log a message to default log.
This function is a replacement for printf().
Messages are always logged to the default log.
| SOFIAPUBFUN void su_log_redirect | ( | su_log_t * | log, | |
| su_logger_f * | logger, | |||
| void * | logarg | |||
| ) |
Redirect a log.
The function su_log_redirect() redirects the su_log() output to logger function. The logger function has following prototype:
void logger(void *logarg, char const *format, va_list ap);
If logger is NULL, the default logger will be used. If log is NULL, the default logger is changed.
| SOFIAPUBFUN void su_log_set_level | ( | su_log_t * | log, | |
| unsigned | level | |||
| ) |
Set log level.
The function su_log_set_level() sets the logging level. The log events have certain level (0..9); if logging level is lower than the level of the event, the log message is ignored.
If log is NULL, the default log level is changed.
| SOFIAPUBFUN void su_log_soft_set_level | ( | su_log_t * | log, | |
| unsigned | level | |||
| ) |
Set log level.
The function su_log_soft_set_level() sets the logging level if it is not already set, or the environment variable controlling the log level is not set.
The log events have certain level (0..9); if logging level is lower than the level of the event, the log message is ignored.
If log is NULL, the default log level is changed.