export_tag log => ('____');
import_arguments qw(logger package_logger default_logger);
-sub arg_router {
+sub router {
our $Router_Instance ||= do {
require Log::Contextual::Router;
Log::Contextual::Router->new
sub before_import {
my ($class, $importer, $spec) = @_;
- my $router = $class->arg_router;
+ my $router = $class->router;
my $exports = $spec->exports;
die 'Log::Contextual does not have a default import list'
$router->before_import(@_);
$spec->add_export('&set_logger', sub {
- my $router = $class->arg_router;
+ my $router = $class->router;
die ref($router) . " does not support set_logger()"
unless $router->does('Log::Contextual::Role::Router::SetLogger');
}) if $exports->{'&set_logger'};
$spec->add_export('&with_logger', sub {
- my $router = $class->arg_router;
+ my $router = $class->router;
die ref($router) . " does not support with_logger()"
unless $router->does('Log::Contextual::Role::Router::WithLogger');
}
}
-sub after_import { $_[0]->arg_router->after_import(@_) }
+sub after_import { $_[0]->router->after_import(@_) }
1;
sub arg_levels { $_[1] || [qw(lol wut zomg)] }
sub arg_logger { $_[1] || $logger }
-sub arg_router {
+sub router {
our $Router_Instance ||= do {
require Log::Contextual::Router;
Log::Contextual::Router->new