From: Thierry FOURNIER / OZON.IO Date: Wed, 23 Nov 2016 00:13:57 +0000 (+0100) Subject: CLEANUP: log-format: useless file and line in json converter X-Git-Tag: v1.7.0~25 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a69c9121878c3b2ec8eb8c94e5fdf61b6f5c8b11;p=thirdparty%2Fhaproxy.git CLEANUP: log-format: useless file and line in json converter 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 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 failed with : invalid args in conv method 'json' : Unexpected input code type. Allowed value are 'ascii', 'utf8', 'utf8s', 'utf8p' and 'utf8ps'. --- diff --git a/src/sample.c b/src/sample.c index 51e61836a0..889ec0ca47 100644 --- a/src/sample.c +++ b/src/sample.c @@ -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; }