File Coverage

blib/lib/XAS/Lib/Log/Console.pm
Criterion Covered Total %
statement 3 6 50.0
branch n/a
condition n/a
subroutine 1 2 50.0
pod 1 1 100.0
total 5 9 55.5


line stmt bran cond sub pod time code
1             package XAS::Lib::Log::Console;
2              
3             our $VERSION = '0.02';
4              
5             use XAS::Class
6 1         5 version => $VERSION,
7             base => 'XAS::Base',
8             utils => ':validation',
9             constants => 'HASHREF',
10 1     1   764 ;
  1         2  
11              
12             # ----------------------------------------------------------------------
13             # Public Methods
14             # ----------------------------------------------------------------------
15              
16             sub output {
17 0     0 1   my $self = shift;
18 0           my ($args) = validate_params(\@_, [
19             { type => HASHREF }
20             ]);
21              
22             warn sprintf("%-5s - %s\n",
23             uc($args->{'priority'}),
24 0           $args->{'message'}
25             );
26              
27             }
28              
29             # ----------------------------------------------------------------------
30             # Private Methods
31             # ----------------------------------------------------------------------
32              
33             1;
34              
35             __END__
36              
37             =head1 NAME
38              
39             XAS::Lib::Log::Console - A class for logging
40              
41             =head1 DESCRIPTION
42              
43             This module is for logging to the terminal. It logs to stderr.
44              
45             =head1 METHODS
46              
47             =head2 new
48              
49             This method initializes the module.
50              
51             =head2 output($hashref)
52              
53             The method formats the hashref and writes out the results.
54              
55             =head1 SEE ALSO
56              
57             =over 4
58              
59             =item L<XAS::Lib::Log|XAS::Lib::Log>
60              
61             =item L<XAS|XAS>
62              
63             =back
64              
65             =head1 AUTHOR
66              
67             Kevin L. Esteb, E<lt>kevin@kesteb.usE<gt>
68              
69             =head1 COPYRIGHT AND LICENSE
70              
71             Copyright (c) 2012-2015 Kevin L. Esteb
72              
73             This is free software; you can redistribute it and/or modify it under
74             the terms of the Artistic License 2.0. For details, see the full text
75             of the license at http://www.perlfoundation.org/artistic_license_2_0.
76              
77             =cut