Mladen Turk wrote:
I start to write some code by extracting part of jk2 and wonder for example about logging.
I'd like to have a pluggable logging function, something which will be by default using stdout/stderr, but which could be overrided to use Apache2 logging functions.
Well, I can extract the apache's logging functions in file that will use stdout/stderr, so we'll have the same api. The file will get complied together with test case, so there will be no need to change something in the core of lib, and we willl not need anything pluggable :). The only difference would be:
#ifdef AJP_TEST_CASE #include "httpd_wrapper.h" #else ... Include the real apache headers #endif
Think that other needed ap_xxx api calls can be written in the same way,
finaly having something like 'dummy apache2 API lib' for testing from
command line.
If we need a request_rec struct for example, we'll make our own surrogate
and fill it only with the needed struct elements, etc...
I think the second part ( a lib_apache ) is better - i.e. use apache functions in mod_ajp, and if it needs to be tested standalone or used with a different server - then you'll link in a lib_apache containing the extracted functions. Maybe a separate directory with the apache headers, functions will e a good idea.
I agree with Mladen that it would be better to use apache, there is no point in adding an extra layer. Well - it would be better if the logging will be part of APR :-)
Costn
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]