httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Stefan Fritsch>
Subject Re: Error codes
Date Wed, 30 Nov 2011 08:09:01 GMT
On Wednesday 30 November 2011, Guenter Knauf wrote:
> Am 30.11.2011 01:51, schrieb William A. Rowe Jr.:
> > On 11/29/2011 5:30 PM, Stefan Fritsch wrote:
> >> Currently my scripts produces:
> >> 
> >>
> >>
> >> 
> >> This is level info and up, but that is easily changed.
> > 
> > Everything from debug level up should be coded. Suggestion,
> > should we allocate numeric ranges per-file, core vs add-on
> > module, so that there is room for expansion?

I am not sure that this is necessary. The error log lines already 
contain the module name or "core".

Actually I currently have two scripts, one that tries to identify 
where to add a number and adds AHxxxx, and another one that takes each 
AHxxxx and replaces it with the next free number. So programmers would 
only need to add AHxxxx and run the second script over the source 

The only disadvantage may be that in a list sorted by log number, 
messages by the same module would not appear next to each other. On 
the other hand, it should be easy to extend the script to also create 
a list sorted by module or source file name if that is useful.

> another suggestion - perhaps add a 3rd char:
> AHCxxxx -> core
> AHMxxxx -> module
> then we would have for both core and modules the whole range of
> 9999 error codes ...

Sometimes we move code from the core to a module or vice versa. If the 
code is mostly unchanged, I would want to keep the error message 
number in this case. So best not encode that in the number, IMHO.

If we ever hit the 9999 codes, we could either switch to hex or add 
another digit. Or would it be better to use 5 digits right away?

Another thought: Would having the AH0815 numbers verbatim in the 
source actually hurt search engine users because they get hits on, github, and whatever. Maybe a macro that hides the 
actual form would be better?

#define APLOGNO(n)  "AH" #n

should do the trick. The source would then contain

ap_log_error(..., APLOGNO(0815) "foo went wrong", ...);

which would not produce a hit for AH0815.


View raw message