blib/lib/XAS/Lib/Modules/Log/Console.pm untested

filter: Statementstmt 0.0% 0 / 15 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 0.0% 0 / 5 Podpod 0.0% 0 / 3 totaltotal 0.0% 0 / 23 CC 1 SCAR 6.9
CC
1
Cov
0%
output
2.0
destroy
2.0
init_log
2.0
CRAP 2.0
1 package XAS::Lib::Modules::Log::Console;
2  
3 our $VERSION = '0.01';
4  
5 use Params::Validate 'HASHREF';
6 use XAS::Class
7 version => $VERSION,
8 base => 'XAS::Base',
9 mixins => 'init_log output destroy',
10 ;
11  
12 # ----------------------------------------------------------------------
13 # Public Methods
14 # ----------------------------------------------------------------------
15  
16 sub output {
17 my $self = shift;
18  
19 my ($args) = $self->validate_params(\@_, [
20 { type => HASHREF }
21 ]);
22  
23 warn sprintf("%-5s - %s\n",
24 uc($args->{priority}),
25 $args->{message}
26 );
27  
28 }
29  
30 sub destroy {
31 my $self = shift;
32  
33 }
34  
35 # ----------------------------------------------------------------------
36 # Private Methods
37 # ----------------------------------------------------------------------
38  
39 sub init_log {
40 my $self = shift;
41 return $self;
42 }
43  
44 1;
45  
46 __END__
47  
48 =head1 NAME
49  
50 XAS::Lib::Modules::Log::Console - A mixin class for logging
51  
52 =head1 DESCRIPTION
53  
54 This module is a mixin for logging. It logs to stderr.
55  
56 =head1 METHODS
57  
58 =head2 init_log
59  
60 This method initializes the module.
61  
62 =head2 output($hashref)
63  
64 The method formats the hashref and writes out the results.
65  
66 =head2 destroy
67  
68 This methods deinitializes the module.
69  
70 =head1 SEE ALSO
71  
72 =over 4
73  
74 =item L<XAS|XAS>
75  
76 =back
77  
78 =head1 AUTHOR
79  
80 Kevin L. Esteb, E<lt>kevin@kesteb.usE<gt>
81  
82 =head1 COPYRIGHT AND LICENSE
83  
84 Copyright (C) 2014 Kevin L. Esteb
85  
86 This library is free software; you can redistribute it and/or modify
87 it under the same terms as Perl itself, either Perl version 5.8.8 or,
88 at your option, any later version of Perl 5 you may have available.
89  
90 See L<http://dev.perl.org/licenses/> for more information.
91  
92 =cut