Permalink
Browse files

Mark private subs with an '_' prefix.

  • Loading branch information...
1 parent 2f37734 commit 1708dc2ff80f596ce6e8c8ecdcfaccdac20fa75b @dolmen committed Oct 24, 2010
Showing with 16 additions and 16 deletions.
  1. +16 −16 lib/POE/Component/Logger.pm
@@ -14,25 +14,25 @@ sub spawn {
my $class = shift;
POE::Session->create(
inline_states => {
- _start => \&start_logger,
- _stop => \&stop_logger,
+ _start => \&_start_logger,
+ _stop => \&_stop_logger,
# more states here for logging of different levels?
- log => \&poe_log,
- debug => sub { local $DefaultLevel='debug'; poe_log(@_)},
- info => sub { local $DefaultLevel='info'; poe_log(@_)},
- notice => sub { local $DefaultLevel='notice'; poe_log(@_)},
- warning => sub {local $DefaultLevel='warning'; poe_log(@_)},
- error => sub { local $DefaultLevel='error';poe_log(@_)},
- critical => sub { local $DefaultLevel='critical';poe_log(@_)},
- alert => sub { local $DefaultLevel='alert';poe_log(@_)},
- emergency => sub {local $DefaultLevel='emergency';poe_log(@_)},
+ log => \&_poe_log,
+ debug => sub { local $DefaultLevel='debug'; _poe_log(@_) },
+ info => sub { local $DefaultLevel='info'; _poe_log(@_) },
+ notice => sub { local $DefaultLevel='notice'; _poe_log(@_) },
+ warning => sub { local $DefaultLevel='warning'; _poe_log(@_) },
+ error => sub { local $DefaultLevel='error'; _poe_log(@_) },
+ critical => sub { local $DefaultLevel='critical'; _poe_log(@_) },
+ alert => sub { local $DefaultLevel='alert'; _poe_log(@_) },
+ emergency => sub { local $DefaultLevel='emergency'; _poe_log(@_) },
},
args => [ @_ ],
);
}
-sub start_logger {
+sub _start_logger {
my ($kernel, $heap, %args) = @_[KERNEL, HEAP, ARG0 .. $#_];
$args{Alias} ||= 'logger';
@@ -44,14 +44,14 @@ sub start_logger {
$kernel->alias_set($args{Alias});
}
-sub stop_logger {
+sub _stop_logger {
my ($kernel, $heap) = @_[KERNEL, HEAP];
$kernel->alias_remove($heap->{_alias});
delete $heap->{_logger};
}
-sub poe_log {
+sub _poe_log {
my ($heap, $arg0, @args) = @_[HEAP, ARG0, ARG1..$#_];
if (ref($arg0)) {
@@ -69,15 +69,15 @@ sub log {
my $class = shift;
POE::Session->create(
inline_states => {
- _start => \&start_logging,
+ _start => \&_start_logging,
},
args => [ @_ ],
);
}
*Logger::log = \&log;
-sub start_logging {
+sub _start_logging {
my ($kernel, @args) = @_[KERNEL, ARG0..$#_];
$kernel->post(logger => log => @args);
}

0 comments on commit 1708dc2

Please sign in to comment.