X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=src%2Flogfile.c;h=ef75052a522b32f446dfbdc1e61b01ae77a45014;hb=48622c3d7c8c0d3ab07cda8a1947c33bfe31df73;hp=ee2ed5cef1ee3f99b72906d9161972cfa3235fe7;hpb=7b0628b4f4688d48d89f94ca381ca6340da05b37;p=collectd.git diff --git a/src/logfile.c b/src/logfile.c index ee2ed5ce..ef75052a 100644 --- a/src/logfile.c +++ b/src/logfile.c @@ -28,8 +28,8 @@ #include "collectd.h" -#include "common.h" #include "plugin.h" +#include "utils/common/common.h" #if COLLECT_DEBUG static int log_level = LOG_DEBUG; @@ -39,9 +39,9 @@ static int log_level = LOG_INFO; static pthread_mutex_t file_lock = PTHREAD_MUTEX_INITIALIZER; -static char *log_file = NULL; +static char *log_file; static int print_timestamp = 1; -static int print_severity = 0; +static int print_severity; static const char *config_keys[] = {"LogLevel", "File", "Timestamp", "PrintSeverity"}; @@ -52,8 +52,8 @@ static int logfile_config(const char *key, const char *value) { log_level = parse_log_severity(value); if (log_level < 0) { log_level = LOG_INFO; - ERROR("logfile: invalid loglevel [%s] defaulting to 'info'", value); - return 1; + WARNING("logfile: invalid loglevel [%s] defaulting to 'info'", value); + return 0; } } else if (0 == strcasecmp(key, "File")) { sfree(log_file);