Nilorea Library
C utilities for networking, threading, graphics
|
Data Structures | |
struct | TS_LOG |
ThreadSafe LOGging structure. More... | |
Macros | |
#define | LOG_ALERT 1 |
action must be taken immediately More... | |
#define | LOG_CRIT 2 |
critical conditions More... | |
#define | LOG_DEBUG 7 |
debug-level messages More... | |
#define | LOG_EMERG 0 |
system is unusable More... | |
#define | LOG_ERR 3 |
error conditions More... | |
#define | LOG_FILE -3 |
internal, logging to file More... | |
#define | LOG_INFO 6 |
informational More... | |
#define | LOG_NOTICE 5 |
normal but significant condition More... | |
#define | LOG_NULL -1 |
no log output More... | |
#define | LOG_STDERR -4 |
internal, default LOG_TYPE More... | |
#define | LOG_SYSJRNL 100 |
to sysjrnl More... | |
#define | LOG_WARNING 4 |
warning conditions More... | |
#define | n_log(__LEVEL__, ...) |
Logging function wrapper to get line and func. More... | |
Functions | |
void | _n_log (int level, const char *file, const char *func, int line, const char *format,...) |
Logging function. More... | |
int | close_safe_logging (TS_LOG *log) |
close a thread-safe logging file More... | |
void | close_sysjrnl (void) |
Close syslog connection or clean internals for event log. More... | |
FILE * | get_log_file (void) |
return the current log_file More... | |
int | get_log_level (void) |
Get the global log level value. More... | |
int | open_safe_logging (TS_LOG **log, char *pathname, char *opt) |
Open a thread-safe logging file. More... | |
char * | open_sysjrnl (char *identity) |
Open connection to syslog or create internals for event log. More... | |
int | set_log_file (char *file) |
Set the logging to a file instead of stderr. More... | |
void | set_log_level (const int log_level) |
Set the global log level value ( static int LOG_LEVEL ) More... | |
int | write_safe_log (TS_LOG *log, char *pat,...) |
write to a thread-safe logging file More... | |
struct TS_LOG |
#define LOG_ALERT 1 |
#define LOG_DEBUG 7 |
debug-level messages
#define LOG_ERR 3 |
error conditions
#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 n_log | ( | __LEVEL__, | |
... | |||
) |
Logging function wrapper to get line and func.
void _n_log | ( | int | level, |
const char * | file, | ||
const char * | func, | ||
int | line, | ||
const char * | format, | ||
... | |||
) |
Logging function.
log( level , const char *format , ... ) is a macro around _log
level | Logging level |
file | File containing the emmited log |
func | Function emmiting the log |
line | Line of the log |
format | Format and string of the log, printf style |
Definition at line 234 of file n_log.c.
References FreeNoLog, get_log_level(), log_file, LOG_NULL, LOG_SYSJRNL, LOG_TYPE, Malloc, prioritynames, proc_name, and vasprintf().
Referenced by _n_nodup_log(), and _n_nodup_log_indexed().
int close_safe_logging | ( | TS_LOG * | log | ) |
void close_sysjrnl | ( | void | ) |
FILE * get_log_file | ( | void | ) |
int get_log_level | ( | void | ) |
int open_safe_logging | ( | TS_LOG ** | log, |
char * | pathname, | ||
char * | opt | ||
) |
char * open_sysjrnl | ( | char * | identity | ) |
Open connection to syslog or create internals for event log.
identity | Tag for syslog or NULL to use argv[0] |
Definition at line 64 of file n_log.c.
References __n_assert, and proc_name.
int set_log_file | ( | char * | file | ) |
Set the logging to a file instead of stderr.
file | The filename where to log |
Definition at line 135 of file n_log.c.
References __n_assert, LOG_FILE, log_file, and set_log_level().
void set_log_level | ( | const int | log_level | ) |
Set the global log level value ( static int LOG_LEVEL )
log_level | Log level value. Supported: NOLOG,LOG_NOTICE/INFO/ERR/DEBUG,LOG_FILE/STDERR/SYSJRNL |
Definition at line 97 of file n_log.c.
References LOG_FILE, LOG_LEVEL, LOG_STDERR, LOG_SYSJRNL, and LOG_TYPE.
Referenced by set_log_file().