Skip to content

Commit

Permalink
Fix spaces.
Browse files Browse the repository at this point in the history
  • Loading branch information
dolmen committed Oct 24, 2010
1 parent 2997de6 commit a24b237
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions lib/POE/Component/Logger.pm
@@ -1,5 +1,3 @@
# $Id: Logger.pm,v 1.1.1.1 2002/01/10 20:48:53 matt Exp $

package POE::Component::Logger; package POE::Component::Logger;
use strict; use strict;


Expand All @@ -18,7 +16,7 @@ sub spawn {
inline_states => { inline_states => {
_start => \&start_logger, _start => \&start_logger,
_stop => \&stop_logger, _stop => \&stop_logger,

# more states here for logging of different levels? # more states here for logging of different levels?
log => \&poe_log, log => \&poe_log,
debug => sub { local $DefaultLevel='debug'; poe_log(@_)}, debug => sub { local $DefaultLevel='debug'; poe_log(@_)},
Expand All @@ -36,26 +34,26 @@ sub spawn {


sub start_logger { sub start_logger {
my ($kernel, $heap, %args) = @_[KERNEL, HEAP, ARG0 .. $#_]; my ($kernel, $heap, %args) = @_[KERNEL, HEAP, ARG0 .. $#_];

$args{Alias} ||= 'logger'; $args{Alias} ||= 'logger';

Log::Dispatch::Config->configure($args{ConfigFile}); Log::Dispatch::Config->configure($args{ConfigFile});

$heap->{_logger} = Log::Dispatch->instance; $heap->{_logger} = Log::Dispatch->instance;
$heap->{_alias} = $args{Alias}; $heap->{_alias} = $args{Alias};
$kernel->alias_set($args{Alias}); $kernel->alias_set($args{Alias});
} }


sub stop_logger { sub stop_logger {
my ($kernel, $heap) = @_[KERNEL, HEAP]; my ($kernel, $heap) = @_[KERNEL, HEAP];

$kernel->alias_remove($heap->{_alias}); $kernel->alias_remove($heap->{_alias});
delete $heap->{_logger}; delete $heap->{_logger};
} }


sub poe_log { sub poe_log {
my ($heap, $arg0, @args) = @_[HEAP, ARG0, ARG1..$#_]; my ($heap, $arg0, @args) = @_[HEAP, ARG0, ARG1..$#_];

if (ref($arg0)) { if (ref($arg0)) {
$heap->{_logger}->log(%$arg0); $heap->{_logger}->log(%$arg0);
} }
Expand Down

0 comments on commit a24b237

Please sign in to comment.