Mercurial > noffle
diff src/database.c @ 185:fed1334d766b noffle
[svn] * src/client.c: Change variable only used on constant to 'const'.
* src/filter.c: Add a couple of 'return's after ASSERT() to remove
compiler warnings about functions needing returns.
* NEWS,TODO,configure,configure.in,noffle.conf.example,docs/NOTES,
docs/noffle.conf.5,src/client.c,src/configfile.c,src/content.c,
src/control.c,src/database.c,src/fetch.c,src/fetchlist.c,src/filter.c,
src/group.c,src/lock.c,src/log.c,src/log.h,src/noffle.c,src/outgoing.c,
src/post.c,src/protocol.c,src/request.c,src/server.c,src/util.c:
Debug logging is always compiled and selected via noffle.conf. All debug
logs are classified as all, none, config, control, expire, fetch,
filter, newsbase, noffle, post, protocol, requests and server.
author | bears |
---|---|
date | Sun, 05 Aug 2001 09:24:22 +0100 |
parents | ad4490c377a4 |
children | 24d4cd032da5 |
line wrap: on
line diff
--- a/src/database.c Tue Jun 19 11:23:43 2001 +0100 +++ b/src/database.c Sun Aug 05 09:24:22 2001 +0100 @@ -1,7 +1,7 @@ /* database.c - $Id: database.c 263 2001-02-28 19:01:33Z enz $ + $Id: database.c 300 2001-08-05 08:24:22Z bears $ Uses GNU gdbm library. Using Berkeley db (included in libc6) was cumbersome. It is based on Berkeley db 1.85, which has severe bugs @@ -80,7 +80,7 @@ Log_err( "Error opening %s for r/w (%s)", name, errMsg() ); return FALSE; } - Log_dbg( "%s opened for r/w", name ); + Log_dbg( LOG_DBG_NEWSBASE, "%s opened for r/w", name ); if ( db.txt == NULL ) db.txt = new_DynStr( 5000 ); @@ -95,7 +95,7 @@ Db_close( void ) { ASSERT( db.dbf ); - Log_dbg( "Closing database" ); + Log_dbg( LOG_DBG_NEWSBASE, "Closing database" ); gdbm_close( db.dbf ); db.dbf = NULL; del_DynStr( db.txt ); @@ -128,7 +128,8 @@ dptr = val.dptr; if ( dptr == NULL ) { - Log_dbg( "database.c loadArt: gdbm_fetch found no entry" ); + Log_dbg( LOG_DBG_NEWSBASE, + "database.c loadArt: gdbm_fetch found no entry" ); return FALSE; } @@ -221,7 +222,7 @@ ASSERT( grp ); msgId = Ov_msgId( ov ); - Log_dbg( "Preparing entry %s", msgId ); + Log_dbg( LOG_DBG_NEWSBASE, "Preparing entry %s", msgId ); if ( Db_contains( msgId ) ) Log_err( "Preparing article twice: %s", msgId ); @@ -249,7 +250,7 @@ ASSERT( db.dbf ); - Log_dbg( "Store article %s", msgId ); + Log_dbg( LOG_DBG_NEWSBASE, "Store article %s", msgId ); if ( ! loadArt( msgId ) ) { Log_err( "Cannot find info about '%s' in database", msgId ); @@ -663,7 +664,8 @@ last[ strlen( last ) - 1 ] = '\0'; Utl_cpyStr( now, ctime( &nowTime ) ); last[ strlen( now ) - 1 ] = '\0'; - Log_dbg( "Expiring %s: last access %s, time now %s", + Log_dbg( LOG_DBG_EXPIRE, + "Expiring %s: last access %s, time now %s", msgId, last, now ); #endif ++cntDel; @@ -671,7 +673,8 @@ else if ( ( texpires != (time_t) -1 ) && nowTime > texpires ) { - Log_dbg( "Expiring %s: Expires header activated", msgId ); + Log_dbg( LOG_DBG_EXPIRE, + "Expiring %s: Expires header activated", msgId ); ++cntDel; } else