When haproxy is run on the foreground with DeviceAtlas enabled, one
line of warning is seen for every test because the comparison is always
true even when loglevel is zero :
willy@wtap:haproxy$ ./haproxy -db -f test-da.cfg
[WARNING] 151/150831 (25506) : deviceatlas : final memory image
7148029 bytes.
Deviceatlas module loaded.
[WARNING] 151/150832 (25506) : deviceatlas : .
[WARNING] 151/150833 (25506) : deviceatlas : .
[WARNING] 151/150833 (25506) : deviceatlas : .
^C
Don't emit a warning when loglevel is null.
static void da_haproxy_log(da_severity_t severity, da_status_t status,
const char *fmt, va_list args)
{
- if (severity <= global.deviceatlas.loglevel) {
+ if (global.deviceatlas.loglevel && severity <= global.deviceatlas.loglevel) {
char logbuf[256];
vsnprintf(logbuf, sizeof(logbuf), fmt, args);
Warning("deviceatlas : %s.\n", logbuf);