Log/Null.pm

filter: Statementstmt 100% 9 / 9 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 100% 3 / 3 Podpod n/a totaltotal 100% 12 / 12 CC 1 SCAR 0.0
CC
1
Cov
100%
BEGIN
1.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.0
« Log/File.pm ↑ Summary Log/Syslog.pm »
1 #
2 # $Id$
3 #
4 # log::null Brik
5 #
6 package Metabrik::Log::Null;
7 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
8 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
9  
10 1 ▶use base qw(Metabrik::Core::Log);
Subroutine BEGIN: called CC=1 SCAR=0.0
11  
12 sub brik_properties {
13 return {
14 revision => '$Revision$',
15 tags => [ qw(unstable logging) ],
16 author => 'GomoR <GomoR[at]metabrik.org>',
17 license => 'http://opensource.org/licenses/BSD-3-Clause',
18 attributes => {
19 level => [ qw(0|1|2|3) ],
20 },
21 commands => {
22 message => [ qw(string caller|OPTIONAL) ],
23 info => [ qw(string caller|OPTIONAL) ],
24 verbose => [ qw(string caller|OPTIONAL) ],
25 warning => [ qw(string caller|OPTIONAL) ],
26 error => [ qw(string caller|OPTIONAL) ],
27 fatal => [ qw(string caller|OPTIONAL) ],
28 debug => [ qw(string caller|OPTIONAL) ],
29 },
30 };
31 }
32  
33 sub warning {
34 my $self = shift;
35  
36 return 1;
37 }
38  
39 sub error {
40 my $self = shift;
41  
42 return;
43 }
44  
45 sub fatal {
46 my $self = shift;
47 my ($msg, $caller) = @_;
48  
49 my $buffer = "[F] ".$self->message($msg, ($caller) ||= caller());
50  
51 die($buffer);
52 }
53  
54 sub info {
55 my $self = shift;
56  
57 return 1;
58 }
59  
60 sub verbose {
61 my $self = shift;
62  
63 return 1;
64 }
65  
66 sub debug {
67 my $self = shift;
68  
69 return 1;
70 }
71  
72 1;
73  
74 __END__
« Log/File.pm ↑ Summary Log/Syslog.pm »