From: Heikki Levanto Date: Thu, 4 Nov 2004 14:19:58 +0000 (+0000) Subject: Fixed a bug that caused extra [level] tags in the log X-Git-Tag: YAZ.2.0.28~5 X-Git-Url: http://sru.miketaylor.org.uk/?a=commitdiff_plain;h=5d309bb5cfcf1fd46efb31c6d240aeb36fc915b5;p=yaz-moved-to-github.git Fixed a bug that caused extra [level] tags in the log --- diff --git a/include/yaz/log.h b/include/yaz/log.h index 2407bf2..9e2a05d 100644 --- a/include/yaz/log.h +++ b/include/yaz/log.h @@ -23,7 +23,7 @@ * LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE * OF THIS SOFTWARE. * - * $Id: log.h,v 1.17 2004-11-03 22:33:17 adam Exp $ + * $Id: log.h,v 1.18 2004-11-04 14:19:58 heikki Exp $ */ /** @@ -113,6 +113,7 @@ YAZ_EXPORT int yaz_log_mask_str(const char *str); /** yaz_log_mask_str_x is like yaz_log_mask_str, but with a given start value*/ YAZ_EXPORT int yaz_log_mask_str_x(const char *str, int level); + /** * yaz_log_module_level returns a log level mask corresponding to the module * name. If that had been specified on the -v arguments (that is, passed to diff --git a/src/log.c b/src/log.c index 4ee727c..024982b 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.11 2004-11-03 22:33:17 adam Exp $ + * $Id: log.c,v 1.12 2004-11-04 14:19:58 heikki Exp $ */ /** @@ -258,8 +258,10 @@ void yaz_log(int level, const char *fmt, ...) { if (*mask_names[i].name && mask_names[i].mask && mask_names[i].mask != LOG_ALL) + { sprintf(flags + strlen(flags), "[%s]", mask_names[i].name); - level -= mask_names[i].mask; + level &= ~mask_names[i].mask; + } } va_start(ap, fmt); #ifdef WIN32