Nilorea Library
C utilities for networking, threading, graphics
Loading...
Searching...
No Matches
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#endif
13
19#include "n_common.h"
20#include "n_log.h"
21#include "n_str.h"
22#include "n_list.h"
23#include "n_hash.h"
24
25/* init the nodup log internal hash_table */
26int init_nodup_log(size_t max);
27/* empty the nodup table */
29/* end nodup session */
30int close_nodup_log();
31
33#define n_nodup_log(__LEVEL__, ...) \
34 do { \
35 _n_nodup_log(__LEVEL__, __FILE__, __func__, __LINE__, __VA_ARGS__); \
36 } while (0)
37
39#define n_nodup_log_indexed(__LEVEL__, __PREF__, ...) \
40 do { \
41 _n_nodup_log_indexed(__LEVEL__, __PREF__, __FILE__, __func__, __LINE__, __VA_ARGS__); \
42 } while (0)
43
44/* no duplicate logging, single */
45void _n_nodup_log(int LEVEL, const char* file, const char* func, int line, const char* format, ...);
46/* no duplicate logging, mutliple with index */
47void _n_nodup_log_indexed(int LEVEL, const char* prefix, const char* file, const char* func, int line, const char* format, ...);
48/* dump the saved duplicate error log hash table in a specific file, human
49 * readable */
50int dump_nodup_log(char* file);
51
56#ifdef __cplusplus
57}
58#endif
59#endif
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:68
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:59
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.