Subject: | Lowering logging threshold "down to" value |
Hi,
I have a web application that's using L4P for logging. Sometimes an extra worker may be created for a background task, and that background task needs to have a decreased logging threshold to capture more detailed output.
I can do something like $logger->level($INFO) to set it up, but if I'm in my development environment, the initial logging threshold may be $DEBUG, so in that case I'm actually increasing the logging threshold...
Similarly, in order to keep the same code between the development and production environments, I can't just do ->dec_level or ->more_logging, since I don't know what level I'm starting at.
It sounds like I should be able to hack something around min($desired_numeric_level, $current_numeric_level), but the docs say "The numerical values assigned to these constants are purely virtual, only used by Log::Log4perl internally and can change at any time, so please don't make any assumptions." Should I go ahead and make assumptions anyway? Can I assume at least that logging levels will remain consistently ordered?