From: Tony B. <log...@tm...> - 2004-01-09 17:17:06
|
On Fri, Jan 09, 2004 at 08:27:05AM -0800, Kevin Goess wrote: > No doubt. When you initialize Log4perl it's initialized for the entire > perl interpreter. With that in mind you don't need to call init() > inside your new() method, just put it in the body of the module so that > it loads once. Then make sure the test's init() method gets called > after the module's init method, like it does in your code sample. See > the patch below. I think I'm missing something fairly fundamental then. I'm using this in a web environment. By default only things of level ERROR get logged. However, requests can supply a parameter, which will switch logging to, for example, INFO level. Thus, in the application, the init() is called per request, based on the CGI paramaters received. So, in my test I really need to make the exact same request twice, except the second time I want to also set that parameter. I then need to check that there were no messages the first time, and certain ones the second time. How can do this? I suspect there's a philosophical problem approach that I'm not quite grokking yet, rather than a technical problem. Tony |