X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FObject%2FRemote%2FLogRouter.pm;h=671856a97a76615a4fa98bc1e3df9f2d013cbc7a;hb=37efeb68748dd589455d8ae58d39e74700abdd67;hp=12ce1a9545f68cd6b90e9e2bc8ce1a51562728f6;hpb=353556c4b81bcb3a0c3fff934eff5ab2f19733d4;p=scpubgit%2FObject-Remote.git diff --git a/lib/Object/Remote/LogRouter.pm b/lib/Object/Remote/LogRouter.pm index 12ce1a9..671856a 100644 --- a/lib/Object/Remote/LogRouter.pm +++ b/lib/Object/Remote/LogRouter.pm @@ -9,32 +9,7 @@ has subscriptions => ( is => 'ro', required => 1, default => sub { [] } ); has description => ( is => 'rw', required => 1 ); sub before_import { } -sub after_import { - my ($self, $controller, $importer, $config) = @_; - my $logger = $controller->arg_logger($config->{logger}); - -# TODO need to review this concept, ignore these configuration values for now -# my $package_logger = $controller->arg_package_logger($config->{package_logger}); -# my $default_logger = $config->{default_logger}; -# -# #when installing a new selector this will be the default -# #logger invoked unless otherwise specified -# $self->{default_logger} = $default_logger; -# -# #if the logger configuration value is specified -# #then all logs given to the router will also be -# #delivered to that logger -# if (defined($logger)) { -# $self->add_selector(sub { 1 }, $logger); -# } -# -# #if the configuration specifies a package logger -# #build a selector that matches the package and -# #install it -# if (defined($package_logger)) { -# $self->add_selector( sub { $_->{package} eq $importer }, $package_logger ); -# } -} +sub after_import { } sub subscribe { my ($self, $logger, $selector, $is_temp) = @_; @@ -71,17 +46,8 @@ sub handle_log_message { #this info to the selector is a good feature local($_) = { level => $level, package => $caller }; if ($selector->(@values)) { - #SOLVED resolve caller_level issues with routing - #idea: the caller level will differ in distance from the - #start of the call stack but it's a constant distance from - #the end of the call stack - can that be exploited to calculate - #the distance from the start right before it's used? - # - #newer idea: in order for log4perl to work right the logger - #must be invoked in the exported log_* method directly - #so by passing the logger down the chain of routers - #it can be invoked in that location and the caller level - #problem doesn't exist anymore + #TODO issues with caller_level have not been resolved yet + #when a logger crosses an object::remote::connection so $logger = $logger->($caller, { caller_level => -1 }); #TODO there is a known issue with the interaction of this