![]() |
Nilorea Library
C utilities for networking, threading, graphics
|
Generic log system. More...
#include <stdio.h>#include <stdlib.h>#include <sys/stat.h>#include <pthread.h>#include "n_common.h"#include <stdarg.h>
Include dependency graph for n_log.h:
This graph shows which files directly or indirectly include this file:Go to the source code of this file.
Data Structures | |
| struct | TS_LOG |
| ThreadSafe LOGging structure. More... | |
Macros | |
| #define | LOG_ALERT 1 |
| action must be taken immediately | |
| #define | LOG_CRIT 2 |
| critical conditions | |
| #define | LOG_DEBUG 7 |
| debug-level messages | |
| #define | LOG_EMERG 0 |
| system is unusable | |
| #define | LOG_ERR 3 |
| error conditions | |
| #define | LOG_FILE -3 |
| internal, logging to file | |
| #define | LOG_INFO 6 |
| informational | |
| #define | LOG_NOTICE 5 |
| normal but significant condition | |
| #define | LOG_NULL -1 |
| no log output | |
| #define | LOG_STDERR -4 |
| internal, default LOG_TYPE | |
| #define | LOG_SYSJRNL 100 |
| to sysjrnl | |
| #define | LOG_WARNING 4 |
| warning conditions | |
| #define | n_log(__LEVEL__, ...) |
| Logging function wrapper to get line and func. | |
Functions | |
| void | _n_log (int level, const char *file, const char *func, int line, const char *format,...) |
| Logging function. | |
| int | close_safe_logging (TS_LOG *log) |
| close a thread-safe logging file | |
| void | close_sysjrnl (void) |
| Close syslog connection or clean internals for event log. | |
| FILE * | get_log_file (void) |
| return the current log_file | |
| int | get_log_level (void) |
| Get the global log level value. | |
| int | open_safe_logging (TS_LOG **log, char *pathname, char *opt) |
| Open a thread-safe logging file. | |
| char * | open_sysjrnl (char *identity) |
| Open connection to syslog or create internals for event log. | |
| int | set_log_file (char *file) |
| Set the logging to a file instead of stderr. | |
| void | set_log_level (const int log_level) |
| Set the global log level value ( static int LOG_LEVEL ) | |
| int | write_safe_log (TS_LOG *log, char *pat,...) |
| write to a thread-safe logging file | |