line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
package Stepford::LoggerWithMoniker; |
2
|
|
|
|
|
|
|
|
3
|
43
|
|
|
43
|
|
317
|
use strict; |
|
43
|
|
|
|
|
102
|
|
|
43
|
|
|
|
|
1245
|
|
4
|
43
|
|
|
43
|
|
278
|
use warnings; |
|
43
|
|
|
|
|
101
|
|
|
43
|
|
|
|
|
1050
|
|
5
|
43
|
|
|
43
|
|
256
|
use namespace::autoclean; |
|
43
|
|
|
|
|
119
|
|
|
43
|
|
|
|
|
232
|
|
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
our $VERSION = '0.006001'; |
8
|
|
|
|
|
|
|
|
9
|
43
|
|
|
43
|
|
18811
|
use Stepford::Types qw( Logger Str ); |
|
43
|
|
|
|
|
183
|
|
|
43
|
|
|
|
|
390
|
|
10
|
|
|
|
|
|
|
|
11
|
43
|
|
|
43
|
|
303666
|
use Moose; |
|
43
|
|
|
|
|
120
|
|
|
43
|
|
|
|
|
382
|
|
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
my $Levels = [qw( debug info notice warning error )]; |
14
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
has _logger => ( |
16
|
|
|
|
|
|
|
is => 'ro', |
17
|
|
|
|
|
|
|
isa => Logger, |
18
|
|
|
|
|
|
|
init_arg => 'logger', |
19
|
|
|
|
|
|
|
required => 1, |
20
|
|
|
|
|
|
|
handles => $Levels, |
21
|
|
|
|
|
|
|
); |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
has _moniker => ( |
24
|
|
|
|
|
|
|
is => 'ro', |
25
|
|
|
|
|
|
|
isa => Str, |
26
|
|
|
|
|
|
|
init_arg => 'moniker', |
27
|
|
|
|
|
|
|
required => 1, |
28
|
|
|
|
|
|
|
); |
29
|
|
|
|
|
|
|
|
30
|
|
|
|
|
|
|
around $Levels => sub { |
31
|
|
|
|
|
|
|
my $orig = shift; |
32
|
|
|
|
|
|
|
my $self = shift; |
33
|
|
|
|
|
|
|
my $message = shift; |
34
|
|
|
|
|
|
|
|
35
|
|
|
|
|
|
|
$message = '[' . $self->_moniker . '] ' . $message; |
36
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
return $self->$orig( $message, @_ ); |
38
|
|
|
|
|
|
|
}; |
39
|
|
|
|
|
|
|
|
40
|
|
|
|
|
|
|
__PACKAGE__->meta->make_immutable; |
41
|
|
|
|
|
|
|
|
42
|
|
|
|
|
|
|
1; |
43
|
|
|
|
|
|
|
|
44
|
|
|
|
|
|
|
# ABSTRACT: The logger used by Step classes. |
45
|
|
|
|
|
|
|
|
46
|
|
|
|
|
|
|
__END__ |
47
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
=pod |
49
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
=encoding UTF-8 |
51
|
|
|
|
|
|
|
|
52
|
|
|
|
|
|
|
=head1 NAME |
53
|
|
|
|
|
|
|
|
54
|
|
|
|
|
|
|
Stepford::LoggerWithMoniker - The logger used by Step classes. |
55
|
|
|
|
|
|
|
|
56
|
|
|
|
|
|
|
=head1 VERSION |
57
|
|
|
|
|
|
|
|
58
|
|
|
|
|
|
|
version 0.006001 |
59
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
=head1 DESCRIPTION |
61
|
|
|
|
|
|
|
|
62
|
|
|
|
|
|
|
This class wraps the logger passed in by the Runner. It prefixes the messages |
63
|
|
|
|
|
|
|
with the step name. This class has no user-facing parts. |
64
|
|
|
|
|
|
|
|
65
|
|
|
|
|
|
|
=head1 SUPPORT |
66
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
Bugs may be submitted through L<https://github.com/maxmind/Stepford/issues>. |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
=head1 AUTHOR |
70
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
Dave Rolsky <drolsky@maxmind.com> |
72
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
=head1 COPYRIGHT AND LICENSE |
74
|
|
|
|
|
|
|
|
75
|
|
|
|
|
|
|
This software is copyright (c) 2014 - 2023 by MaxMind, Inc. |
76
|
|
|
|
|
|
|
|
77
|
|
|
|
|
|
|
This is free software; you can redistribute it and/or modify it under |
78
|
|
|
|
|
|
|
the same terms as the Perl 5 programming language system itself. |
79
|
|
|
|
|
|
|
|
80
|
|
|
|
|
|
|
=cut |