--- /dev/null
+package Object::Remote::Logging;
+
+use strictures 1;
+
+use Log::Contextual::Routed qw( :log );
+use base qw(Log::Contextual::Routed);
+
+sub get_parent_router { $_[0]->SUPER::get_parent_router }
+
+use Data::Dumper;
+
+sub init_node { my $n = `hostname`; chomp($n); $_[0]->add_child_router("[node $n]", __PACKAGE__->get_root_router) }
+
+1;
+
use Moo;
+use Object::Remote::Logging qw( :log );
+
has module_sender => (is => 'ro', required => 1);
has inc_hook => (is => 'lazy');
sub _build_inc_hook {
my ($self) = @_;
- Object::Remote::ModuleLoader::Hook->new(sender => $self->module_sender);
+ log_debug { "Constructing module builder hook" };
+ #TODO why didn't log_trace return the argument?
+ logS_trace { "Done constructing module builder hook" }
+ Object::Remote::ModuleLoader::Hook->new(sender => $self->module_sender);
}
sub BUILD { shift->enable }
use Object::Remote::ModuleSender;
use Object::Remote::Handle;
use Object::Remote::Future;
+use Object::Remote::Logging qw( :log );
use Scalar::Util qw(blessed);
use Moo::Role;
return future {
$f->on_done(sub {
my ($conn) = $f->get;
+ $conn->remote_sub('Object::Remote::Logging::init_node')
+ ->(Object::Remote::Logging->get_router);
Object::Remote::Handle->new(
connection => $conn,
class => 'Object::Remote::ModuleLoader',