[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: nick vajberg <nickvajberg_at_yahoo.dk>
Date: 2005-07-14 18:35:01 CEST

> On Jul 13, 2005, at 10:29 AM, nick vajberg wrote:
> I'm thinking of APIs like:
>
> - open/close a logfile
> - write a client-action into a logfile
> - write a debugging string into a logfile
>
> I'd love to discuss/design these APIs.

Some thoughts:

1) A factory would be nice, hence hiding whether the
logger is using a file, a socket or whatever. The
factory function would return a baton for the logger.

I.e:

svn_logger* logger = svn_logger_get(const char*
logger, int mode);

Subsequent log calls would use this baton (which
contains stuff like file descriptors)

This factory call *could* dynamically load logger
libraries, but that may be over the top.

2) For files: must be able to open the log in
append/rolling mode.

E.g:

svn_logger_get("file", mode_append);

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);

...as well as a generic one:

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

---------------------------------------------------------------------
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:35:45 2005

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