]> git.ipfire.org Git - thirdparty/haproxy.git/commitdiff
CLEANUP: log-format: useless file and line in json converter
authorThierry FOURNIER / OZON.IO <thierry.fournier@ozon.io>
Wed, 23 Nov 2016 00:13:57 +0000 (01:13 +0100)
committerWilly Tarreau <w@1wt.eu>
Thu, 24 Nov 2016 17:54:25 +0000 (18:54 +0100)
The caller must log location information, so this information is
provided two times in the log line. The error log is like this:

   [ALERT] 327/011513 (14291) : parsing [o3.conf:38]: 'http-response
   set-header': Sample fetch <method,json(rrr)> failed with : invalid
   args in conv method 'json' : Unexpected input code type at file
   'o3.conf', line 38. Allowed value are 'ascii', 'utf8', 'utf8s',
   'utf8p' and 'utf8ps'.

This patch removes the second location indication, the the same error
becomes:

   [ALERT] 327/011637 (14367) : parsing [o3.conf:38]: 'http-response
   set-header': Sample fetch <method,json(rrr)> failed with : invalid
   args in conv method 'json' : Unexpected input code type. Allowed
   value are 'ascii', 'utf8', 'utf8s', 'utf8p' and 'utf8ps'.

src/sample.c

index 51e61836a0e3458694fceb9d13408573f98f7f35..889ec0ca47986052a062f0a51e1ee5134743c7cb 100644 (file)
@@ -1693,8 +1693,8 @@ static int sample_conv_json_check(struct arg *arg, struct sample_conv *conv,
                return 1;
        }
 
-       memprintf(err, "Unexpected input code type at file '%s', line %d. "
-                      "Allowed value are 'ascii', 'utf8', 'utf8s', 'utf8p' and 'utf8ps'", file, line);
+       memprintf(err, "Unexpected input code type. "
+                      "Allowed value are 'ascii', 'utf8', 'utf8s', 'utf8p' and 'utf8ps'");
        return 0;
 }