Log-Report-Optional
view release on metacpan or search on metacpan
lib/Log/Report/Minimal.pm view on Meta::CPAN
### if you change anything here, you also have to change Log::Report::Minimal
my @make_msg = qw/__ __x __n __nx __xn N__ N__n N__w/;
my @functions = qw/report dispatcher try textdomain/;
my @reason_functions = qw/trace assert info notice warning mistake error fault alert failure panic/;
our @EXPORT_OK = (@make_msg, @functions, @reason_functions);
sub trace(@); sub assert(@); sub info(@); sub notice(@); sub warning(@);
sub mistake(@); sub error(@); sub fault(@); sub alert(@); sub failure(@);
sub panic(@); sub report(@); sub textdomain($@);
sub __($); sub __x($@); sub __n($$$@); sub __nx($$$@); sub __xn($$$@);
sub N__($); sub N__n($$); sub N__w(@);
my ($mode, %need);
sub need($)
{ $mode = shift;
%need = map +($_ => 1), expand_reasons mode_accepts $mode;
}
need 'NORMAL';
my %textdomains;
lib/Log/Report/Minimal.pm view on Meta::CPAN
sub warning(@) {_report {}, WARNING => @_}
sub mistake(@) {_report {}, MISTAKE => @_}
sub error(@) {_report {}, ERROR => @_}
sub fault(@) {_report {}, FAULT => @_}
sub alert(@) {_report {}, ALERT => @_}
sub failure(@) {_report {}, FAILURE => @_}
sub panic(@) {_report {}, PANIC => @_}
#--------------------
sub __($) { $_[0] }
sub __x($@)
{ @_%2 or error __x"even length parameter list for __x at {where}", where => join(' line ', (caller)[1,2]);
_interpolate @_, _expand => 1;
}
sub __n($$$@)
( run in 2.440 seconds using v1.01-cache-2.11-cpan-524268b4103 )