| 1 | package Sprocket::Logger::Basic; | ||||||||||||||||||||
| 2 | |||||||||||||||||||||
| 3 | 5 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 4 | 5 | ▶ | use warnings; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 5 | |||||||||||||||||||||
| 6 | 10 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: called CC=2 SCAR=8.1
Pod
undocumented
| |||||||||||||||||||||
| 7 | 10 | my $class = shift; | |||||||||||||||||||
| 8 | 10 | ▶ | bless( {}, ref $class || $class ); | ||||||||||||||||||
|
Condition33%1/3
ref $class || $class
MC/DC0%0/2
ref $class || $class
ref $class
$class
Truth table33%1/3
A || B
A= ref $classB= $class
| |||||||||||||||||||||
| 9 | } | ||||||||||||||||||||
| 10 | |||||||||||||||||||||
| 11 | 24 | ▶ | sub put { | ||||||||||||||||||
|
Subroutine
put: called CC=7 SCAR=36.3
Pod
documented
| |||||||||||||||||||||
| 12 | 24 | my ($self, $sprocket, $opts) = @_; | |||||||||||||||||||
| 13 | |||||||||||||||||||||
| 14 | 24 | ▶ | return unless ( $opts->{v} <= $sprocket->{opts}->{log_level} ); | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 15 | 0 | my $con = $sprocket->{heap}; | |||||||||||||||||||
| 16 | 0 | ▶ | my $sender = ( $con ) | ||||||||||||||||||
|
Branch: 2 branches
| |||||||||||||||||||||
| 17 | ? ( $con->peer_addr ? $con->peer_addr : '' )."(".$con->ID.")" : "?"; | ||||||||||||||||||||
| 18 | 0 | ▶ | my $l = $opts->{l} ? $opts->{l}+2 : 2; | ||||||||||||||||||
|
Branch: 1 branch
| |||||||||||||||||||||
| 19 | 0 | ▶ | my $caller = $opts->{call} ? $opts->{call} : ( caller($l) )[3] || '?'; | ||||||||||||||||||
|
Branch: 1 branch
Condition0%0/2
(caller $l)[3] or "?"
MC/DC0%0/1
(caller $l)[3] or "?"
(caller $l)[3]
Truth table0%0/2
A
A= (caller $l)[3]
| |||||||||||||||||||||
| 20 | 0 | $caller =~ s/^POE::Component/PoCo/o; | |||||||||||||||||||
| 21 | 0 | $caller =~ s/^Sprocket::Plugin/SPlugin/o; | |||||||||||||||||||
| 22 | 0 | print STDERR '['.localtime()."][pid:$$][$sprocket->{connections}][$caller][$sender] $opts->{msg}\n"; | |||||||||||||||||||
| 23 | } | ||||||||||||||||||||
| 24 | |||||||||||||||||||||
| 25 | 5 | 1; | |||||||||||||||||||
| 26 | |||||||||||||||||||||
| 27 | __END__ | ||||||||||||||||||||