From 5d309bb5cfcf1fd46efb31c6d240aeb36fc915b5 Mon Sep 17 00:00:00 2001 From: Heikki Levanto Date: Thu, 4 Nov 2004 14:19:58 +0000 Subject: [PATCH] Fixed a bug that caused extra [level] tags in the log --- include/yaz/log.h | 3 ++- src/log.c | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) 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 -- 1.7.10.4