On 6/3/2010 11:49 AM, Stefan Fritsch wrote: > > I have added two additional patches (filenames 10*) to fix a segfault. > In addition, I now have this in http_log.h: > > #define APLOG_NO_MODULE -1 > > static int * const aplog_module_index; > #define APLOG_MODULE_INDEX \ > (aplog_module_index ? *aplog_module_index : APLOG_NO_MODULE) > > > This means, if some source file does not initialize aplog_module_index > with APLOG_USE_MODULE, logging will simply default to the global > loglevel. This works because static pointers are initialized to NULL > if no explicit initialization is given. > > I think that's a nice solution. Modules from 2.2.x continue to work > without changes. But in order to benefit from per-module loglevel > configuration, they have to use the new macros.
This seems to be a very good solution, and the fact that their are no constructor-time calls to initialize this should avoid any platform quirks. My only question is; are we assured to have the same module_index reassigned on each config/reload phase? The reason I'm worried is that this code won't refresh the index, but there may be platforms that don't actually do a module unload/reload/reinit heap of aplog_module_index to NULL.
