| 1 | package Log::NullLogLite; | ||||||||||||||||||||
| 2 | |||||||||||||||||||||
| 3 | 1 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 4 | 1 | ▶ | use vars qw($VERSION @ISA); | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 5 | |||||||||||||||||||||
| 6 | 1 | $VERSION = 0.82; | |||||||||||||||||||
| 7 | |||||||||||||||||||||
| 8 | # According to the Null pattern. | ||||||||||||||||||||
| 9 | # | ||||||||||||||||||||
| 10 | # Log::NullLogLite inherits from Log::LogLite and implement the Null | ||||||||||||||||||||
| 11 | # Object Pattern. | ||||||||||||||||||||
| 12 | 1 | ▶ | use Log::LogLite; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 13 | 1 | @ISA = ("Log::LogLite"); | |||||||||||||||||||
| 14 | package Log::NullLogLite; | ||||||||||||||||||||
| 15 | 1 | ▶ | use strict; | ||||||||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||||||||
| 16 | |||||||||||||||||||||
| 17 | ########################################## | ||||||||||||||||||||
| 18 | # new($filepath) | ||||||||||||||||||||
| 19 | # new($filepath,$level) | ||||||||||||||||||||
| 20 | # new($filepath,$level,$default_message) | ||||||||||||||||||||
| 21 | ########################################## | ||||||||||||||||||||
| 22 | # the constructor | ||||||||||||||||||||
| 23 | 1 | ▶ | sub new { | ||||||||||||||||||
|
Subroutine
new: called CC=2 SCAR=7.2
Pod
documented
| |||||||||||||||||||||
| 24 | 1 | my $proto = shift; # get the class name | |||||||||||||||||||
| 25 | 1 | ▶ | my $class = ref($proto) || $proto; | ||||||||||||||||||
|
Condition33%1/3
ref $proto || $proto
MC/DC0%0/2
ref $proto || $proto
ref $proto
$proto
Truth table33%1/3
A || B
A= ref $protoB= $proto
| |||||||||||||||||||||
| 26 | 1 | my $self = {}; | |||||||||||||||||||
| 27 | 1 | bless ($self, $class); | |||||||||||||||||||
| 28 | 1 | return $self; | |||||||||||||||||||
| 29 | } # of new | ||||||||||||||||||||
| 30 | |||||||||||||||||||||
| 31 | ######################## | ||||||||||||||||||||
| 32 | # write($message, $level) | ||||||||||||||||||||
| 33 | ######################## | ||||||||||||||||||||
| 34 | # will log the message in the log file only if $level>=LEVEL | ||||||||||||||||||||
| 35 | 1 | ▶ | sub write { | ||||||||||||||||||
|
Subroutine
write: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||||||||
| 36 | 1 | my $self = shift; | |||||||||||||||||||
| 37 | } # of write | ||||||||||||||||||||
| 38 | |||||||||||||||||||||
| 39 | ########################## | ||||||||||||||||||||
| 40 | # level() | ||||||||||||||||||||
| 41 | # level($level) | ||||||||||||||||||||
| 42 | ########################## | ||||||||||||||||||||
| 43 | # an interface to LEVEL | ||||||||||||||||||||
| 44 | 0 | ▶ | sub level { | ||||||||||||||||||
|
Subroutine
level: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||
| 45 | 0 | my $self = shift; | |||||||||||||||||||
| 46 | 0 | return -1; | |||||||||||||||||||
| 47 | } # of level | ||||||||||||||||||||
| 48 | |||||||||||||||||||||
| 49 | ########################### | ||||||||||||||||||||
| 50 | # default_message() | ||||||||||||||||||||
| 51 | # default_message($message) | ||||||||||||||||||||
| 52 | ########################### | ||||||||||||||||||||
| 53 | # an interface to DEFAULT_MESSAGE | ||||||||||||||||||||
| 54 | 0 | ▶ | sub default_message { | ||||||||||||||||||
|
Subroutine
default_message: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||||||||||
| 55 | 0 | my $self = shift; | |||||||||||||||||||
| 56 | 0 | return ""; | |||||||||||||||||||
| 57 | } # of default_message | ||||||||||||||||||||
| 58 | |||||||||||||||||||||
| 59 | 1 | 1; | |||||||||||||||||||
| 60 | __END__ | ||||||||||||||||||||