contrib/docker: add LD_PRELOAD wrapper to fopen/open/opendir syscalls
[collectd.git] / src / log_logstash.c
index 45aa86d..24083a5 100644 (file)
@@ -27,6 +27,7 @@
  **/
 
 #include "collectd.h"
+
 #include "common.h"
 #include "plugin.h"
 
@@ -64,12 +65,12 @@ static int log_logstash_config (const char *key, const char *value)
 
        if (0 == strcasecmp (key, "LogLevel")) {
                log_level = parse_log_severity(value);
-        if (log_level < 0) {
-            log_level = LOG_INFO;
-            ERROR("log_logstash: invalid loglevel [%s] defaulting to 'info'",
-                  value);
-            return 1;
-        }
+               if (log_level < 0) {
+                       log_level = LOG_INFO;
+                       ERROR("log_logstash: invalid loglevel [%s] defaulting to 'info'",
+                               value);
+                       return 1;
+               }
        }
        else if (0 == strcasecmp (key, "File")) {
                sfree (log_file);
@@ -89,7 +90,6 @@ static void log_logstash_print (yajl_gen g, int severity,
        struct tm timestamp_tm;
        char timestamp_str[64];
        const unsigned char *buf;
-       time_t tt;
 #if HAVE_YAJL_V2
        size_t len;
 #else
@@ -139,8 +139,7 @@ static void log_logstash_print (yajl_gen g, int severity,
            yajl_gen_status_ok)
                goto err;
 
-       tt = CDTIME_T_TO_TIME_T (timestamp_time);
-       gmtime_r (&tt, &timestamp_tm);
+       gmtime_r (&CDTIME_T_TO_TIME_T (timestamp_time), &timestamp_tm);
 
        /*
         * format time as a UTC ISO 8601 compliant string