![]() |
Nilorea Library
C utilities for networking, threading, graphics
|
generic no duplicate logging system More...
#include <stdio.h>#include <stdarg.h>#include "nilorea/n_common.h"#include "nilorea/n_log.h"#include "nilorea/n_str.h"#include "nilorea/n_list.h"#include "nilorea/n_hash.h"#include "nilorea/n_nodup_log.h"
Include dependency graph for n_nodup_log.c:Go to the source code of this file.
Macros | |
| #define | _GNU_SOURCE |
| Feature test macro. | |
| #define | _GNU_SOURCE_WAS_NOT_DEFINED |
| flag to detect if gnu source was set from our source file | |
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 | check_n_log_dup (const char *log, const char *file, const char *func, int line) |
| check if a log was already done or not at the given line, func, file | |
| int | check_n_log_dup_indexed (const char *log, const char *file, const char *func, int line, const char *prefix) |
| check if a log was already done or not at the given line, func, file | |
| 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. | |
| static char * | get_nodup_indexed_key (const char *file, const char *func, const char *prefix, int line) |
| internal, get a key for an indexed log entry | |
| static char * | get_nodup_key (const char *file, const char *func, int line) |
| internal, get a key for a log entry | |
| int | init_nodup_log (size_t max) |
| initialize the no duplicate logging system | |
Variables | |
| static HASH_TABLE * | _n_nodup_table = NULL |
| internal: no dup hash_table log save | |
| #define _GNU_SOURCE |
| #define _GNU_SOURCE_WAS_NOT_DEFINED |
flag to detect if gnu source was set from our source file
Definition at line 13 of file n_nodup_log.c.
| int check_n_log_dup | ( | const char * | log, |
| const char * | file, | ||
| const char * | func, | ||
| int | line | ||
| ) |
check if a log was already done or not at the given line, func, file
| log | the line of log |
| file | the file containing the log |
| func | the name of calling func |
| line | the line of the log |
Definition at line 118 of file n_nodup_log.c.
References __n_assert, _n_nodup_table, HASH_NODE::data, Free, get_nodup_key(), ht_get_node(), key, and HASH_DATA::string.
Referenced by _n_nodup_log().
Here is the call graph for this function:
Here is the caller graph for this function:| int check_n_log_dup_indexed | ( | const char * | log, |
| const char * | file, | ||
| const char * | func, | ||
| int | line, | ||
| const char * | prefix | ||
| ) |
check if a log was already done or not at the given line, func, file
| log | the line of log |
| file | the file containing the log |
| func | the name of calling func |
| line | the line of the log |
| prefix | prefix to subgroup logs |
Definition at line 155 of file n_nodup_log.c.
References __n_assert, _n_nodup_table, HASH_NODE::data, Free, get_nodup_indexed_key(), ht_get_node(), key, and HASH_DATA::string.
Referenced by _n_nodup_log_indexed().
Here is the call graph for this function:
Here is the caller graph for this function:
|
static |
internal, get a key for an indexed log entry
| file | log source file |
| func | log source |
| line | log source |
| prefix | prefix for log entry |
Definition at line 99 of file n_nodup_log.c.
References __n_assert, N_STR::data, Free, and nstrprintf.
Referenced by _n_nodup_log_indexed(), and check_n_log_dup_indexed().
Here is the caller graph for this function:
|
static |
internal, get a key for a log entry
| file | log source file |
| func | log source |
| line | log source |
Definition at line 81 of file n_nodup_log.c.
References __n_assert, N_STR::data, Free, and nstrprintf.
Referenced by _n_nodup_log(), and check_n_log_dup().
Here is the caller graph for this function:
|
static |
internal: no dup hash_table log save
Definition at line 30 of file n_nodup_log.c.
Referenced by _n_nodup_log(), _n_nodup_log_indexed(), check_n_log_dup(), check_n_log_dup_indexed(), close_nodup_log(), dump_nodup_log(), empty_nodup_table(), and init_nodup_log().