Nilorea Library
C utilities for networking, threading, graphics
n_nodup_log.h
Go to the documentation of this file.
1
7#ifndef __NO_DUP_LOG_HEADER_GUARD__
8#define __NO_DUP_LOG_HEADER_GUARD__
9
10#ifdef __cplusplus
11extern "C"
12{
13#endif
14
20#include "n_common.h"
21#include "n_log.h"
22#include "n_str.h"
23#include "n_list.h"
24#include "n_hash.h"
25
26/* init the nodup log internal hash_table */
27int init_nodup_log( int max );
28/* empty the nodup table */
30/* end nodup session */
31int close_nodup_log();
32
34#define n_nodup_log( __LEVEL__ , ... ) \
35 do \
36 { \
37 _n_nodup_log( __LEVEL__ , __FILE__ , __func__ , __LINE__ , __VA_ARGS__ ); \
38 }while( 0 )
39
41#define n_nodup_log_indexed( __LEVEL__ , __PREF__ , ... ) \
42 do \
43 { \
44 _n_nodup_log_indexed( __LEVEL__ , __PREF__ , __FILE__ , __func__ , __LINE__ , __VA_ARGS__ ); \
45 }while( 0 )
46
47/* no duplicate logging, single */
48void _n_nodup_log( int LEVEL, const char *file, const char *func, int line, const char *format, ... );
49/* no duplicate logging, mutliple with index */
50void _n_nodup_log_indexed( int LEVEL, const char *prefix, const char *file, const char *func, int line, const char *format, ... );
51/* dump the saved duplicate error log hash table in a specific file, human
52 * readable */
53int dump_nodup_log( char *file );
54
59#ifdef __cplusplus
60}
61#endif
62#endif
int dump_nodup_log(char *file)
Dump the duplicate error log hash table in a file.
Definition: n_nodup_log.c:350
int close_nodup_log()
Empty nodup logtable and close the no duplicate logging session.
Definition: n_nodup_log.c:79
void _n_nodup_log(int LEVEL, const char *file, const char *func, int line, const char *format,...)
Logging function.
Definition: n_nodup_log.c:220
int empty_nodup_table()
Empty the nodup internal table.
Definition: n_nodup_log.c:67
void _n_nodup_log_indexed(int LEVEL, const char *prefix, const char *file, const char *func, int line, const char *format,...)
Logging function.
Definition: n_nodup_log.c:288
int init_nodup_log(int max)
initialize the no duplicate logging system
Definition: n_nodup_log.c:36
Common headers and low-level hugly functions & define.
Hash functions and table.
List structures and definitions.
Generic log system.
N_STR and string function declaration.