|
cwist
Modern C web framework with libttak runtime
|
Macro-based logging implementation. More...

Go to the source code of this file.
Macros | |
| #define | _POSIX_C_SOURCE 200809L |
Functions | |
| void | cwist_log_write (cwist_macro_log_level_t level, const char *fmt,...) |
| Write a single log record to stderr with a timestamp and level tag. | |
Variables | |
| cwist_macro_log_level_t | g_cwist_log_level = CWIST_LOG_LEVEL_NONE |
| Global active log level. Set this to control output verbosity. | |
Macro-based logging implementation.
Definition in file log.c.
| void cwist_log_write | ( | cwist_macro_log_level_t | level, |
| const char * | fmt, | ||
| ... | |||
| ) |
Write a single log record to stderr with a timestamp and level tag.
Write a log message to stderr.
Emits one line of the form [LEVEL] [YYYY-MM-DD HH:MM:SS] <formatted message> to stderr. Unknown level values print as ???. Output is not buffered beyond the C runtime's default stderr buffering; no synchronization is performed, so interleaving may occur when called concurrently from multiple threads.
| level | Severity tag for the record (INFO, WARN, ERROR, DEBUG, or other). |
| fmt | printf-style format string, followed by its arguments. |
Definition at line 25 of file log.c.
References CWIST_LOG_LEVEL_DEBUG, CWIST_LOG_LEVEL_ERROR, CWIST_LOG_LEVEL_INFO, and CWIST_LOG_LEVEL_WARN.
| cwist_macro_log_level_t g_cwist_log_level = CWIST_LOG_LEVEL_NONE |