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

Re: libsvn_repos logging APIs (was Re: Proposal for Logging in Svnserve)

From: John Peacock <jpeacock_at_rowman.com>
Date: 2005-07-14 18:59:06 CEST

nick vajberg wrote:
> 3) API reflects log levels. This increases
> readability.
>
> Based on log4j (which works well, IMO):
>
> svn_log_debug(svn_logger* logger, const char*
> message);
> svn_log_info(svn_logger* logger, const char* message);
> svn_log_warn(svn_logger* logger, const char* message);
> svn_log_error(svn_logger* logger, const char*
> message);
> svn_log_fatal(svn_logger* logger, const char*
> message);

Yuck! How is that any more readable than:

svn_log(int level, svn_logger* logger, const char* message);

called (using appropriately shaped #defines) like this:

svn_log(DEBUG, logger, message);
svn_log(INFO, logger, message);
svn_log(WARN, logger, message);
svn_log(ERROR, logger, message);
svn_log(FATAL, logger, message);

The log level is an *variable* of logging API, not a top level object.
There is really no justification for seperate functions, since they
should all be using the same lower level code. If you really like your
signatures, there could always be syntactic sugar #define's.

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 Thu Jul 14 18:59:29 2005

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