X-Git-Url: http://git.indexdata.com/?p=yaz-moved-to-github.git;a=blobdiff_plain;f=src%2Flog.c;h=945ca16654d193a5799ec68700a9abea95424ccc;hp=134ce986611dec6fc9ff53193b0f7bd95c2a8919;hb=05e1dd414a3bcf5601a620ecd7b85f530517bc64;hpb=d7b75f236b92e98bff554317e123753d0549c3c3 diff --git a/src/log.c b/src/log.c index 134ce98..945ca16 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.3 2004-11-02 11:37:21 heikki Exp $ + * $Id: log.c,v 1.5 2004-11-02 12:57:54 heikki Exp $ */ /** @@ -69,6 +69,7 @@ static struct { { LOG_APP2 , "app2" }, { LOG_APP3 , "app3" }, { LOG_ALL, "all" }, + { LOG_FLUSH, "flush" }, { 0, "none" }, { 0, NULL } }; @@ -208,7 +209,8 @@ void yaz_log(int level, const char *fmt, ...) tbuf[TIMEFORMAT_LEN-1]='\0'; fprintf(l_file, "%s %s%s %s%s\n", tbuf, l_prefix, flags, l_prefix2, buf); - fflush(l_file); + if (l_level & (LOG_FLUSH|LOG_DEBUG) ) + fflush(l_file); if (end_hook_func) (*end_hook_func)(o_level, buf, end_hook_info); }