X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=src%2Flog.c;h=ecdb45819a78c20bfad66b6141adfaa95970d1a0;hp=d8a36524a810b7bb8be7ad0907ac2674e3154783;hb=a94620ffd6001681474a94f5de767f168d772d1c;hpb=30e703f75c26ad4b564e380d586d122edd49046d diff --git a/src/log.c b/src/log.c index d8a3652..ecdb458 100644 --- a/src/log.c +++ b/src/log.c @@ -2,7 +2,7 @@ * Copyright (c) 1995-2004, Index Data * See the file LICENSE for details. * - * $Id: log.c,v 1.14 2004-11-16 17:08:11 heikki Exp $ + * $Id: log.c,v 1.15 2004-11-17 13:03:07 heikki Exp $ */ /** @@ -397,15 +397,22 @@ int yaz_log_mask_str_x (const char *str, int level) const char *p; int i; int found; + int negated; char clean[255] = ""; char *n = clean; while (*str) { found = 0; + negated=0; for (p = str; *p && *p != ','; p++) ; - if (*str == '-' || isdigit(*str)) + if (*str=='-') + { + negated=1; + str++; + } + if (isdigit(*str)) { level = atoi (str); found = 1; @@ -417,7 +424,10 @@ int yaz_log_mask_str_x (const char *str, int level) if (0==strcmp (mask_names[i].name,n)) { if (mask_names[i].mask) - level |= mask_names[i].mask; + if (negated) + level &= ~mask_names[i].mask; + else + level |= mask_names[i].mask; else level = 0; /* 'none' clears them all */ found = 1;