revise log router api to match log::contextual router api change
[scpubgit/Object-Remote.git] / lib / Object / Remote / Role / LogForwarder.pm
index 4a4f4af..5be6851 100644 (file)
@@ -1,7 +1,10 @@
+#This is an experimental method for working with
+#Log::Contextual crossing Object::Remote connections
+#transparently 
+
 package Object::Remote::Role::LogForwarder;
 
 use Moo::Role; 
-use Object::Remote::Logging; 
 use Scalar::Util qw(weaken);
 use Carp qw(cluck);
 
@@ -28,8 +31,8 @@ sub describe {
   $depth++;
   my $buf = "\t" x $depth . $self->description . "\n";
   foreach my $child (@{$self->child_routers}) {
-      next unless defined $child; 
-      $buf .= $child->describe($depth);
+    next unless defined $child; 
+    $buf .= $child->describe($depth);
   }
     
   return $buf; 
@@ -38,16 +41,18 @@ sub describe {
 sub add_child_router {
   my ($self, $router) = @_;
   push(@{ $self->child_routers }, $router);
+  #TODO re-weaken when object::remote proxied
+  #weak references is figured out
 #   weaken(${ $self->child_routers }[-1]);
   return; 
 }
 
 #sub remove_child_router {
-#   my ($self, $description) = @_;
-#   return delete $self->child_routers->{$description};
+#  my ($self, $description) = @_;
+#  return delete $self->child_routers->{$description};
 #}
 
-after handle_log_message => sub {
+after get_loggers => sub {
   my ($self, @args) = @_;
   my $parent = $self->parent_router;