summaryrefslogtreecommitdiffstats
path: root/net/haproxy/patches/0001-add-halog-version.patch
blob: 38eb7f45946242250199f6db2b64b493b1074c0a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
--- a/admin/halog/halog.c
+++ b/admin/halog/halog.c
@@ -44,6 +44,15 @@
 #define SEP(c) ((unsigned char)(c) <= ' ')
 #define SKIP_CHAR(p,c) do { while (1) { int __c = (unsigned char)*p++; if (__c == c) break; if (__c <= ' ') { p--; break; } } } while (0)
 
+#define STR2(x) #x
+#define STR(x) STR2(x)
+
+#ifdef HALOG_VERSION
+#define HALOG_BUILD_INFO "halog - HAProxy log statistics reporter (" STR(HALOG_VERSION) ")\n"
+#else
+#define HALOG_BUILD_INFO "halog - HAProxy log statistics reporter\n"
+#endif
+
 /* [0] = err/date, [1] = req, [2] = conn, [3] = resp, [4] = data */
 static struct eb_root timers[5] = {
 	EB_ROOT_UNIQUE, EB_ROOT_UNIQUE, EB_ROOT_UNIQUE,
@@ -165,6 +174,7 @@ void usage(FILE *output, const char *msg
 {
 	fprintf(output,
 		"%s"
+		"%s"
 		"Usage:\n"
 		"  halog [-h|--help] for long help\n"
 		"  halog [input_filters]* [modifiers]* [output_format] < log\n"
@@ -174,7 +184,8 @@ void usage(FILE *output, const char *msg
 		"    out = {-c|-u|-uc|-ue|-ua|-ut|-uao|-uto|-uba|-ubt|-hdr <block>:<field>|\n"
 		"           -cc|-gt|-pct|-st|-tc|-srv|-ic}\n"
 		"\n",
-		msg ? msg : ""
+		msg ? msg : "",
+		HALOG_BUILD_INFO
 		);
 }