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"
Go to the source code of this file.
Macros | |
#define | _GNU_SOURCE |
Feature test macro. More... | |
#define | _GNU_SOURCE_WAS_NOT_DEFINED |
flag to detect if gnu source was set from our source file More... | |
Functions | |
void | _n_nodup_log (int LEVEL, const char *file, const char *func, int line, const char *format,...) |
Logging function. More... | |
void | _n_nodup_log_indexed (int LEVEL, const char *prefix, const char *file, const char *func, int line, const char *format,...) |
Logging function. More... | |
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 More... | |
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 More... | |
int | close_nodup_log () |
Empty nodup logtable and close the no duplicate logging session. More... | |
int | dump_nodup_log (char *file) |
Dump the duplicate error log hash table in a file. More... | |
int | empty_nodup_table () |
Empty the nodup internal table. More... | |
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 More... | |
static char * | get_nodup_key (const char *file, const char *func, int line) |
internal, get a key for a log entry More... | |
int | init_nodup_log (int max) |
initialize the no duplicate logging system More... | |
Variables | |
static HASH_TABLE * | _n_nodup_table = NULL |
internal: no dup hash_table log save More... | |
#define _GNU_SOURCE |
#define _GNU_SOURCE_WAS_NOT_DEFINED |
flag to detect if gnu source was set from our source file
Definition at line 12 of file n_nodup_log.c.
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 137 of file n_nodup_log.c.
References __n_assert, _n_nodup_table, Free, get_nodup_key(), and ht_get_node().
Referenced by _n_nodup_log().
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 180 of file n_nodup_log.c.
References __n_assert, _n_nodup_table, Free, get_nodup_indexed_key(), and ht_get_node().
Referenced by _n_nodup_log_indexed().
|
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 114 of file n_nodup_log.c.
References __n_assert, Free, and nstrprintf.
Referenced by _n_nodup_log_indexed(), and check_n_log_dup_indexed().
|
static |
internal, get a key for a log entry
file | log source file |
func | log source |
line | log source |
Definition at line 93 of file n_nodup_log.c.
References __n_assert, Free, and nstrprintf.
Referenced by _n_nodup_log(), and check_n_log_dup().
|
static |
internal: no dup hash_table log save
Definition at line 29 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().