I am using the "Levels" plugin successfully in test scripts that test what I am logging with Log::Any. The involved module is Log::Any::Test that sets
$Log::Any::OverrideDefaultAdapterClass = 'Log::Any::Adapter::Test';
$Log::Any::OverrideDefaultProxyClass = 'Log::Any::Proxy::Test';
at compile-time. Out of curiosity I took a closer look at the Log::Any::Plugin implementation. This line
my $adapter_class = ref Log::Any->get_logger(category => caller());
looks questionable because Log::Any->get_logger() isn't an adapter class object but a proxy class object. In my use case $adapter_class has the value 'Log::Any::Proxy::Test'! If this is true in gerenal the whole Log::Any::Plugin documentations seems to be incorrect because the plugins don't modify adapters but proxies! The reason for this inaccuracy might be the 1.00 change of Log::Any at the end of 2014
- Logging now goes via a Log::Any::Proxy object instead of directly to an adapter. This allows easy customization of the message production.
I am using the "Levels" plugin successfully in test scripts that test what I am logging with
Log::Any. The involved module isLog::Any::Testthat setsat compile-time. Out of curiosity I took a closer look at the
Log::Any::Pluginimplementation. This linemy $adapter_class = ref Log::Any->get_logger(category => caller());looks questionable because Log::Any->get_logger() isn't an adapter class object but a proxy class object. In my use case
$adapter_classhas the value 'Log::Any::Proxy::Test'! If this is true in gerenal the wholeLog::Any::Plugindocumentations seems to be incorrect because the plugins don't modify adapters but proxies! The reason for this inaccuracy might be the 1.00 change ofLog::Anyat the end of 2014