X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FObject%2FRemote.pm;h=feee52a7f2bb927ffa1bd192f7437c4ea7d46f30;hb=4e4463355a9ec6afdc7983ee36daa9f11306d4fc;hp=0e9a559fab021cd0310fbc84b9030971e24215f6;hpb=9c01f262452bf2451e15ae16bb5488447ea3d1e9;p=scpubgit%2FObject-Remote.git diff --git a/lib/Object/Remote.pm b/lib/Object/Remote.pm index 0e9a559..feee52a 100644 --- a/lib/Object/Remote.pm +++ b/lib/Object/Remote.pm @@ -2,19 +2,26 @@ package Object::Remote; use Object::Remote::MiniLoop; use Object::Remote::Handle; +use Object::Remote::Logging qw( :log ); use Module::Runtime qw(use_module); -our $VERSION = '0.002001'; # 0.2.1 +our $VERSION = '0.002003'; # 0.2.3 + +BEGIN { + Object::Remote::Logging->init_logging; +} sub new::on { my ($class, $on, @args) = @_; my $conn = __PACKAGE__->connect($on); + log_trace { sprintf("constructing instance of $class on connection for child pid of %i", $conn->child_pid) }; return $conn->remote_object(class => $class, args => \@args); } sub can::on { my ($class, $on, $name) = @_; my $conn = __PACKAGE__->connect($on); + log_trace { "Invoking remote \$class->can('$name')" }; return $conn->remote_sub(join('::', $class, $name)); } @@ -25,7 +32,7 @@ sub new { sub connect { my ($class, $to) = @_; - use_module('Object::Remote::Connection')->new_from_spec($to); + use_module('Object::Remote::Connection')->maybe::start::new_from_spec($to); } sub current_loop {