diff --git a/doc/lua.txt b/doc/lua.txt index 9bf9f144d..d05ff1de1 100644 --- a/doc/lua.txt +++ b/doc/lua.txt @@ -642,7 +642,7 @@ the associated error. open("./luac/concat.so", O_RDONLY|O_CLOEXEC) = 4 - [ALERT] 293/175822 (22806) : parsing [commonstats.conf:15] : lua runtime + [ALERT] (22806) : parsing [commonstats.conf:15] : lua runtime error: error loading module 'luac/concat' from file './luac/concat.so': ./luac/concat.so: undefined symbol: luaopen_luac/concat diff --git a/doc/regression-testing.txt b/doc/regression-testing.txt index 1b6c21d10..aac312cde 100644 --- a/doc/regression-testing.txt +++ b/doc/regression-testing.txt @@ -228,9 +228,9 @@ as expected (verbose mode execution): **** h1 0.0 macro def h1_name=/tmp/vtc.25540.59b6ec5d/h1 ** h1 0.0 Wait ** h1 0.0 Stop HAproxy pid=25558 - *** h1 0.0 debug|[ALERT] 157/135318 (25558) : parsing [/tmp/vtc.25540.59b6ec5d/h1/cfg:10] : 'filter' : ''spoe' : missing config file' - *** h1 0.0 debug|[ALERT] 157/135318 (25558) : Error(s) found in configuration file : /tmp/vtc.25540.59b6ec5d/h1/cfg - *** h1 0.0 debug|[ALERT] 157/135318 (25558) : Fatal errors found in configuration. + *** h1 0.0 debug|[ALERT] (25558) : parsing [/tmp/vtc.25540.59b6ec5d/h1/cfg:10] : 'filter' : ''spoe' : missing config file' + *** h1 0.0 debug|[ALERT] (25558) : Error(s) found in configuration file : /tmp/vtc.25540.59b6ec5d/h1/cfg + *** h1 0.0 debug|[ALERT] (25558) : Fatal errors found in configuration. **** h1 0.0 STDOUT poll 0x10 ** h1 0.0 WAIT4 pid=25558 status=0x0100 (user 0.000000 sys 0.000000) ** h1 0.0 Found expected '' diff --git a/src/log.c b/src/log.c index fe0e3a2ea..f760bacba 100644 --- a/src/log.c +++ b/src/log.c @@ -1081,14 +1081,19 @@ int parse_logsrv(char **args, struct list *logsrvs, int do_del, const char *file /* Generic function to display messages prefixed by a label */ static void print_message(const char *label, const char *fmt, va_list argp) { - struct tm tm; char *head, *msg; + char prefix[11]; // '[' + 8 chars + ']' + 0. + + *prefix = '['; + strncpy(prefix + 1, label, sizeof(prefix) - 2); + msg = prefix + strlen(prefix); + *msg++ = ']'; + while (msg < prefix + sizeof(prefix) - 1) + *msg++ = ' '; + *msg = 0; head = msg = NULL; - - get_localtime(date.tv_sec, &tm); - memprintf(&head, "[%s] %03d/%02d%02d%02d (%d) : ", - label, tm.tm_yday, tm.tm_hour, tm.tm_min, tm.tm_sec, (int)getpid()); + memprintf(&head, "%s (%u) : ", prefix, (uint)getpid()); memvprintf(&msg, fmt, argp); if (global.mode & MODE_STARTING) { @@ -1160,7 +1165,7 @@ void ha_warning(const char *fmt, ...) */ void _ha_vdiag_warning(const char *fmt, va_list argp) { - print_message("DIAG/WARNING", fmt, argp); + print_message("DIAG", fmt, argp); } /*