![]() |
Nilorea Library
C utilities for networking, threading, graphics
|
Macros | |
#define | n_nodup_log(__LEVEL__, ...) |
nodup log macro helper | |
#define | n_nodup_log_indexed(__LEVEL__, __PREF__, ...) |
nodup log indexed macro helper | |
Functions | |
void | _n_nodup_log (int LEVEL, const char *file, const char *func, int line, const char *format,...) |
Logging function. | |
void | _n_nodup_log_indexed (int LEVEL, const char *prefix, const char *file, const char *func, int line, const char *format,...) |
Logging function. | |
int | close_nodup_log () |
Empty nodup logtable and close the no duplicate logging session. | |
int | dump_nodup_log (char *file) |
Dump the duplicate error log hash table in a file The table is first written to a temporary file which is then renamed to the final destination and permissions set via rename() and chmod() . | |
int | empty_nodup_table () |
Empty the nodup internal table. | |
int | init_nodup_log (size_t max) |
#define n_nodup_log | ( | __LEVEL__, | |
... | |||
) |
nodup log macro helper
Definition at line 33 of file n_nodup_log.h.
#define n_nodup_log_indexed | ( | __LEVEL__, | |
__PREF__, | |||
... | |||
) |
nodup log indexed macro helper
Definition at line 39 of file n_nodup_log.h.
void _n_nodup_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 188 of file n_nodup_log.c.
References __n_assert, _n_log(), _n_nodup_table, check_n_log_dup(), HASH_NODE::data, Free, get_nodup_key(), ht_get_node(), ht_put_string(), LOG_ERR, n_log, HASH_DATA::string, and vasprintf().
void _n_nodup_log_indexed | ( | int | LEVEL, |
const char * | prefix, | ||
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 |
prefix | prefix to subgroup logs |
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 250 of file n_nodup_log.c.
References _n_log(), _n_nodup_table, check_n_log_dup_indexed(), HASH_NODE::data, Free, get_nodup_indexed_key(), ht_get_node(), ht_put_string(), LOG_ERR, n_log, HASH_DATA::string, and vasprintf().
int close_nodup_log | ( | ) |
Empty nodup logtable and close the no duplicate logging session.
Definition at line 68 of file n_nodup_log.c.
References __n_assert, _n_nodup_table, and destroy_ht().
int dump_nodup_log | ( | char * | file | ) |
Dump the duplicate error log hash table in a file The table is first written to a temporary file which is then renamed to the final destination and permissions set via rename()
and chmod()
.
file | The path and filename to the dump file |
Definition at line 306 of file n_nodup_log.c.
References __n_assert, _n_nodup_table, _str, HASH_NODE::data, Free, HASH_TABLE::hash_table, list_foreach, LOG_DEBUG, LOG_ERR, n_log, HASH_TABLE::size, HASH_DATA::string, and strprintf.
int empty_nodup_table | ( | ) |
Empty the nodup internal table.
Definition at line 59 of file n_nodup_log.c.
References __n_assert, _n_nodup_table, and empty_ht().
int init_nodup_log | ( | size_t | max | ) |
Definition at line 35 of file n_nodup_log.c.