mirror of
https://github.com/bol-van/zapret.git
synced 2025-12-31 11:55:55 +03:00
autohostlist debug
This commit is contained in:
@@ -56,7 +56,7 @@ struct params_s
|
||||
|
||||
strpool *hostlist, *hostlist_exclude;
|
||||
struct str_list_head hostlist_files, hostlist_exclude_files;
|
||||
char hostlist_auto_filename[PATH_MAX];
|
||||
char hostlist_auto_filename[PATH_MAX], hostlist_auto_debuglog[PATH_MAX];
|
||||
int hostlist_auto_fail_threshold, hostlist_auto_fail_time;
|
||||
hostfail_pool *hostlist_auto_fail_counters;
|
||||
|
||||
@@ -72,3 +72,15 @@ extern struct params_s params;
|
||||
#define _DBGPRINT(format, level, ...) { if (params.debug>=level) printf(format "\n", ##__VA_ARGS__); }
|
||||
#define VPRINT(format, ...) _DBGPRINT(format,1,##__VA_ARGS__)
|
||||
#define DBGPRINT(format, ...) _DBGPRINT(format,2,##__VA_ARGS__)
|
||||
|
||||
#define LOG_APPEND(filename, format, ...) \
|
||||
{ \
|
||||
FILE *F = fopen(filename,"at"); \
|
||||
if (F) \
|
||||
{ \
|
||||
fprint_localtime(F); \
|
||||
fprintf(F, " : " format "\n", ##__VA_ARGS__); \
|
||||
fclose(F); \
|
||||
} \
|
||||
}
|
||||
#define HOSTLIST_DEBUGLOG_APPEND(format, ...) if (*params.hostlist_auto_debuglog) LOG_APPEND(params.hostlist_auto_debuglog, format, ##__VA_ARGS__)
|
||||
|
||||
Reference in New Issue
Block a user