![]() |
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,...) |
| log a message only once per unique location | |
| void | _n_nodup_log_indexed (int LEVEL, const char *prefix, const char *file, const char *func, int line, const char *format,...) |
| log a message only once per unique prefix and location | |
| int | close_nodup_log () |
| close the nodup log session | |
| int | dump_nodup_log (char *file) |
| dump the nodup log hash table to a file in human-readable form | |
| int | empty_nodup_table () |
| empty the nodup table | |
| int | init_nodup_log (size_t max) |
| init the nodup log internal hash table | |
| #define n_nodup_log | ( | __LEVEL__, | |
| ... | |||
| ) |
nodup log macro helper
Definition at line 52 of file n_nodup_log.h.
| #define n_nodup_log_indexed | ( | __LEVEL__, | |
| __PREF__, | |||
| ... | |||
| ) |
nodup log indexed macro helper
Definition at line 58 of file n_nodup_log.h.
| void _n_nodup_log | ( | int | LEVEL, |
| const char * | file, | ||
| const char * | func, | ||
| int | line, | ||
| const char * | format, | ||
| ... | |||
| ) |
log a message only once per unique location
log a message only once per unique location
log( level , const char *format , ... ) is a macro around _log
| LEVEL | Logging level |
| file | File containing the emitted log |
| func | Function emitting the log |
| line | Line of the log |
| format | Format and string of the log, printf style |
Definition at line 207 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(), key, LOG_ERR, n_log, HASH_DATA::string, and vasprintf().
Here is the call graph for this function:| void _n_nodup_log_indexed | ( | int | LEVEL, |
| const char * | prefix, | ||
| const char * | file, | ||
| const char * | func, | ||
| int | line, | ||
| const char * | format, | ||
| ... | |||
| ) |
log a message only once per unique prefix and location
log a message only once per unique prefix and location
log( level , const char *format , ... ) is a macro around _log
| LEVEL | Logging level |
| prefix | prefix to subgroup logs |
| file | File containing the emitted log |
| func | Function emitting the log |
| line | Line of the log |
| format | Format and string of the log, printf style |
Definition at line 273 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(), key, LOG_ERR, n_log, HASH_DATA::string, and vasprintf().
Here is the call graph for this function:| int close_nodup_log | ( | ) |
close the nodup log session
close the nodup log session
Definition at line 87 of file n_nodup_log.c.
References __n_assert, _n_nodup_table, and destroy_ht().
Referenced by main().
Here is the call graph for this function:
Here is the caller graph for this function:| int dump_nodup_log | ( | char * | file | ) |
dump the nodup log hash table to a file in human-readable form
dump the nodup log hash table to a file in human-readable form
| file | The path and filename to the dump file |
Definition at line 333 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.
Referenced by main().
Here is the caller graph for this function:| int empty_nodup_table | ( | ) |
empty the nodup table
empty the nodup table
Definition at line 78 of file n_nodup_log.c.
References __n_assert, _n_nodup_table, and empty_ht().
Here is the call graph for this function:| int init_nodup_log | ( | size_t | max | ) |
init the nodup log internal hash table
init the nodup log internal hash table
| max | the max size of the internal hash table. Leave it to zero to keep the internal value in use ( 1024 ) |
Definition at line 54 of file n_nodup_log.c.
References _n_nodup_table, LOG_DEBUG, LOG_ERR, n_log, and new_ht().
Referenced by main().
Here is the call graph for this function:
Here is the caller graph for this function: