X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?p=scpubgit%2FObject-Remote.git;a=blobdiff_plain;f=lib%2FObject%2FRemote%2FLogging%2FLogger.pm;h=78f3890b899e661dc36d1125e676c7a129e5b7df;hp=e53dbf32e56337e50868607ac018dcc0b86c26a1;hb=1a90d0eeb2ed492e0f7f84e95c67161491d8f79e;hpb=293fb1ee44fb32ff692278802149f42a5e391197 diff --git a/lib/Object/Remote/Logging/Logger.pm b/lib/Object/Remote/Logging/Logger.pm index e53dbf3..78f3890 100644 --- a/lib/Object/Remote/Logging/Logger.pm +++ b/lib/Object/Remote/Logging/Logger.pm @@ -48,8 +48,8 @@ sub AUTOLOAD { } sub _build_max_level { - my ($self) = @_; - return $self->level_names->[-1]; + my ($self) = @_; + return $self->level_names->[-1]; } sub _build__level_active { @@ -112,8 +112,10 @@ sub _render_time { sub _render_remote { my ($self, $remote) = @_; - return 'local' if ! defined $remote || ! defined $remote->{connection_id}; - return 'remote #' . $remote->{connection_id}; + return 'local' unless defined $remote; + my $conn_id = $remote->{connection_id}; + $conn_id = '(uninit)' unless defined $conn_id; + return "remote #$conn_id"; } sub _render_log { @@ -173,7 +175,7 @@ Object::Remote::Logging::Logger - Format and output a log message #router will hold this logger forever #and send it all log messages - router->connect(Object::Remote::Logging::WarnLogger->new( + router->connect(Object::Remote::Logging::Logger->new( level_names => arg_levels, format => '%s at %f line %i, log level: %l' min_level => 'warn', max_level => 'error', )); @@ -302,7 +304,7 @@ received the log message on the local interpreter if the log message was forward =item %r -Log::Remote connection information rendered into a string. +Object::Remote connection information rendered into a string. =item %c @@ -337,6 +339,10 @@ Process id of the Perl interpreter that generated the log message. A literal %. +=item %n + +A newline. + =back =back