"Daniel Shahaf" <[email protected]> writes:

> On Monday, November 21, 2011 5:45 PM, "Philip Martin" 
> <[email protected]> wrote:
>> [email protected] writes:
>> 
>> >  
>> > -  ap_log_rerror(APLOG_MARK, APLOG_ERR, APR_EGENERAL, r, "%s", 
>> > err->message);
>> > +  while (err)
>> > +    {
>> > +      ap_log_rerror(APLOG_MARK, APLOG_ERR, APR_EGENERAL, r, "%s", 
>> > err->message);
>> > +      err = err->child;
>> > +    }
>> >  }
>> 
>> I'm wondering whether this is correct.  Should it skip duplicates like
>> svn_handle_error2?  Should it use svn_err_best_message like
>> svnserve/serve.c:log_error?
>
> Using svn_err_best_message() would DTRT when err->message is NULL.

ap_log_rerror handles NULL.

> Filtering duplicates would be nice.  (I'm thinking of multiple processes
> logging to the same file; it would surely make the file more readable if
> each process didn't repeat a given message N times.)  Perhaps some logic
> from svn_handle_error2() could be reused?

I suppose it depends on whether the tracing should be logged.  svnserve
use svn_err_best_message and doesn't remove duplicates, so the log looks
like:

25058 2011-11-21T17:13:44.479972Z 127.0.0.1 - repo ERR 
../src/subversion/libsvn_fs_fs/rep-cache.c 226 200029 Couldn't open rep-cache 
database
25058 2011-11-21T17:13:44.479972Z 127.0.0.1 - repo ERR- 
../src/subversion/libsvn_fs_fs/rep-cache.c 124 200029 Couldn't open rep-cache 
database
25058 2011-11-21T17:13:44.479972Z 127.0.0.1 - repo ERR- 
../src/subversion/libsvn_subr/atomic.c 60 200029 Couldn't perform atomic 
initialization
25058 2011-11-21T17:13:44.479972Z 127.0.0.1 - repo ERR- 
../src/subversion/libsvn_fs_fs/rep-cache.c 103 200029 Couldn't perform atomic 
initialization
25058 2011-11-21T17:13:44.479972Z 127.0.0.1 - repo ERR- 
../src/subversion/libsvn_subr/sqlite.c 749 200029 Couldn't perform atomic 
initialization
25058 2011-11-21T17:13:44.479972Z 127.0.0.1 - repo ERR- 
../src/subversion/libsvn_subr/atomic.c 60 200029 Couldn't perform atomic 
initialization
25058 2011-11-21T17:13:44.479972Z 127.0.0.1 - repo ERR- 
../src/subversion/libsvn_subr/sqlite.c 611 200030 SQLite compiled for 3.7.3, 
but running with 3.6.3

Perhaps svn_error_purge_tracing?

-- 
uberSVN: Apache Subversion Made Easy
http://www.uberSVN.com

Reply via email to