[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Svnserve still exiting randomly in threaded mode

From: John Peacock <jpeacock_at_rowman.com>
Date: 2004-05-18 19:43:20 CEST

Branko Čibej wrote:
> The first mistake everybody seems to make is to forget that parameter
> evaluation takes time, so they put debug level checks into the logging
> functions themselves. You wouldn't _balieve_ the kind of slowdown this
> can cause.

Could you elaborate on this a little? I'm not sure I know what you are
referring to.

I believe there are two major ways to structure log code (ignoring compile-time
#ifdef):

1) Anywhere you want to log something, call a common log routine with a log type
(error, info, and debug) and a message; the log routine the decides what to send
where;

2) Anywhere you want to log something, call a specific routine for the type of
log message;

In both cases, the call to the logger routine should be wrapped by a check
against a global loglevel variable.

        if ( loglevel > 0 ) /* log everything */ {log_this(DEBUG,"message")}
        if ( loglevel == 1 ) /* log info only */ {log_this(INFO,"message")}

Is this last point what you were worried about? Some of that could even be
hidden by a macro.

I would prefer to use the 1st mode above, as it makes for a slightly cleaner
interface and makes it much easier to have a single output stream (if so desired).

John

-- 
John Peacock
Director of Information Research and Technology
Rowman & Littlefield Publishing Group
4501 Forbes Boulevard
Suite H
Lanham, MD  20706
301-459-3366 x.5010
fax 301-429-5748
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Tue May 18 19:43:22 2004

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.