|
NAMELog::Any::Adapter::Capture - Adapter for capturing log messages into an arrayrefVERSIONversion 1.710SYNOPSIS# temporarily redirect arrays of [ $level, $category, $message ] into an array Log::Any::Adapter->set( { lexically => \my $scope }, Capture => to => \my @array ); # temporarily redirect just the text of log messages into an array Log::Any::Adapter->set( { lexically => \my $scope }, Capture => text => \my @array ); # temporarily redirect the full argument list and context of each call, but only for # log levels 'info' and above. Log::Any::Adapter->set( { lexically => \my $scope }, Capture => format => 'structured', to => \my @array, log_level => 'info' ); DESCRIPTIONThis logging adapter provides a convenient way to capture log messages into a callback or arrayref of your choice without needing to write your own adapter. It is intended for cases where you want to temporarily capture log messages, such as showing them to a user of your application rather than having them written to a log file.ATTRIBUTEStoSpecify a coderef or arrayref where the messages will be delivered. The content pushed onto the array or passed to the coderef depends on "format".format
log_levelLike other logging adapters, this optional argument can filter out any log messages above the specified threshhold. The default is to pass through all messages regardless of level.ATTRIBUTE ALIASESThese are not actual attributes, just shortcuts for others:texttext => $dest is shorthand for format => 'text', to => $dest structuredstructured => $dest is shorthand for format => 'structured', to => $dest AUTHORS
COPYRIGHT AND LICENSEThis software is copyright (c) 2017 by Jonathan Swartz, David Golden, and Doug Bell.This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself.
Visit the GSP FreeBSD Man Page Interface. |