Nilorea Library
C utilities for networking, threading, graphics
Loading...
Searching...
No Matches
n_nodup_log.h
Go to the documentation of this file.
1
8#ifndef __NO_DUP_LOG_HEADER_GUARD__
9#define __NO_DUP_LOG_HEADER_GUARD__
10
11#ifdef __cplusplus
12extern "C" {
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(size_t max);
28/* empty the nodup table */
30/* end nodup session */
31int close_nodup_log();
32
34#define n_nodup_log(__LEVEL__, ...) \
35 do { \
36 _n_nodup_log(__LEVEL__, __FILE__, __func__, __LINE__, __VA_ARGS__); \
37 } while (0)
38
40#define n_nodup_log_indexed(__LEVEL__, __PREF__, ...) \
41 do { \
42 _n_nodup_log_indexed(__LEVEL__, __PREF__, __FILE__, __func__, __LINE__, __VA_ARGS__); \
43 } while (0)
44
45/* no duplicate logging, single */
46void _n_nodup_log(int LEVEL, const char* file, const char* func, int line, const char* format, ...);
47/* no duplicate logging, mutliple with index */
48void _n_nodup_log_indexed(int LEVEL, const char* prefix, const char* file, const char* func, int line, const char* format, ...);
49/* dump the saved duplicate error log hash table in a specific file, human
50 * readable */
51int dump_nodup_log(char* file);
52
57#ifdef __cplusplus
58}
59#endif
60#endif
int init_nodup_log(size_t max)
initialize the no duplicate logging system
Definition n_nodup_log.c:36
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 whic...
int close_nodup_log()
Empty nodup logtable and close the no duplicate logging session.
Definition n_nodup_log.c:69
void _n_nodup_log(int LEVEL, const char *file, const char *func, int line, const char *format,...)
Logging function.
int empty_nodup_table()
Empty the nodup internal table.
Definition n_nodup_log.c:60
void _n_nodup_log_indexed(int LEVEL, const char *prefix, const char *file, const char *func, int line, const char *format,...)
Logging function.
Common headers and low-level functions & define.
Hash functions and table.
List structures and definitions.
Generic log system.
N_STR and string function declaration.