hierarchical log routing is now implemented in object-remote instead of log-contextual
[scpubgit/Object-Remote.git] / lib / Object / Remote / LogDestination.pm
1 package Object::Remote::LogDestination;
2
3 use Moo; 
4 use Scalar::Util qw(weaken);
5
6 has logger => ( is => 'ro', required => 1 );
7 has subscriptions => ( is => 'ro', required => 1, default => sub { [] } ); 
8
9 sub select {
10    my ($self, $router, $selector) = @_; 
11    my $subscription = $router->subscribe($self->logger, $selector); 
12    push(@{ $self->subscriptions }, $subscription);
13    return $subscription; 
14 }
15
16 sub connect {
17    my ($self, $router) = @_; 
18    return $self->select($router, sub { 1 });
19 }
20
21 1;