diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2018-11-07 12:19:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2018-11-07 12:20:17 +0000 |
commit | a64a253794ac64cb40befee54db53bde17dd0d49 (patch) | |
tree | c1024acc5f6e508814b944d99f112259bb28b1be /libnetdata/log/log.h | |
parent | New upstream version 1.10.0+dfsg (diff) | |
download | netdata-a64a253794ac64cb40befee54db53bde17dd0d49.tar.xz netdata-a64a253794ac64cb40befee54db53bde17dd0d49.zip |
New upstream version 1.11.0+dfsgupstream/1.11.0+dfsg
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to '')
-rw-r--r-- | libnetdata/log/log.h (renamed from src/log.h) | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/log.h b/libnetdata/log/log.h index 81c85481b..48e1599a7 100644 --- a/src/log.h +++ b/libnetdata/log/log.h @@ -1,6 +1,10 @@ +// SPDX-License-Identifier: GPL-3.0-or-later + #ifndef NETDATA_LOG_H #define NETDATA_LOG_H 1 +#include "../libnetdata.h" + #define D_WEB_BUFFER 0x0000000000000001 #define D_WEB_CLIENT 0x0000000000000002 #define D_LISTENER 0x0000000000000004 @@ -55,8 +59,8 @@ extern int access_log_syslog; extern int error_log_syslog; extern int output_log_syslog; -extern time_t error_log_throttle_period, error_log_throttle_period_backup; -extern unsigned long error_log_errors_per_period; +extern time_t error_log_throttle_period; +extern unsigned long error_log_errors_per_period, error_log_errors_per_period_backup; extern int error_log_limit(int reset); extern void open_all_log_files(); @@ -64,8 +68,11 @@ extern void reopen_all_log_files(); static inline void debug_dummy(void) {} -#define error_log_limit_reset() do { error_log_throttle_period = error_log_throttle_period_backup; error_log_limit(1); } while(0) -#define error_log_limit_unlimited() do { error_log_throttle_period = 0; } while(0) +#define error_log_limit_reset() do { error_log_errors_per_period = error_log_errors_per_period_backup; error_log_limit(1); } while(0) +#define error_log_limit_unlimited() do { \ + error_log_limit_reset(); \ + error_log_errors_per_period = ((error_log_errors_per_period_backup * 10) < 10000) ? 10000 : (error_log_errors_per_period_backup * 10); \ + } while(0) #ifdef NETDATA_INTERNAL_CHECKS #define debug(type, args...) do { if(unlikely(debug_flags & type)) debug_int(__FILE__, __FUNCTION__, __LINE__, ##args); } while(0) |