| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
package Log::Shiras::Report::MetaMessage; |
|
2
|
|
|
|
|
|
|
our $AUTHORITY = 'cpan:JANDREW'; |
|
3
|
1
|
|
|
1
|
|
358
|
use version; our $VERSION = version->declare("v0.44.0"); |
|
|
1
|
|
|
|
|
1
|
|
|
|
1
|
|
|
|
|
4
|
|
|
4
|
|
|
|
|
|
|
#~ use lib '../../../'; |
|
5
|
|
|
|
|
|
|
#~ use Log::Shiras::Unhide qw( :InternalReporTMetaMessagE ); |
|
6
|
|
|
|
|
|
|
###InternalReporTMetaMessagE warn "You uncovered internal logging statements for Log::Shiras::Report::MetaMessage-$VERSION" if !$ENV{hide_warn}; |
|
7
|
|
|
|
|
|
|
###InternalReporTMetaMessagE use Log::Shiras::Switchboard; |
|
8
|
|
|
|
|
|
|
###InternalReporTMetaMessagE my $switchboard = Log::Shiras::Switchboard->instance; |
|
9
|
1
|
|
|
1
|
|
72
|
use 5.010; |
|
|
1
|
|
|
|
|
2
|
|
|
10
|
1
|
|
|
1
|
|
4
|
use utf8; |
|
|
1
|
|
|
|
|
7
|
|
|
|
1
|
|
|
|
|
6
|
|
|
11
|
1
|
|
|
1
|
|
16
|
use Moose::Role; |
|
|
1
|
|
|
|
|
1
|
|
|
|
1
|
|
|
|
|
4
|
|
|
12
|
1
|
|
|
1
|
|
3037
|
use MooseX::Types::Moose qw( ArrayRef HashRef CodeRef ); |
|
|
1
|
|
|
|
|
1
|
|
|
|
1
|
|
|
|
|
6
|
|
|
13
|
1
|
|
|
1
|
|
3254
|
use Carp 'confess'; |
|
|
1
|
|
|
|
|
2
|
|
|
|
1
|
|
|
|
|
343
|
|
|
14
|
|
|
|
|
|
|
|
|
15
|
|
|
|
|
|
|
#########1 Public Attributes 3#########4#########5#########6#########7#########8#########9 |
|
16
|
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
has pre_sub =>( |
|
18
|
|
|
|
|
|
|
isa => CodeRef, |
|
19
|
|
|
|
|
|
|
clearer => 'clear_pre_sub', |
|
20
|
|
|
|
|
|
|
predicate => 'has_pre_sub', |
|
21
|
|
|
|
|
|
|
reader => 'get_pre_sub', |
|
22
|
|
|
|
|
|
|
writer => 'set_pre_sub', |
|
23
|
|
|
|
|
|
|
); |
|
24
|
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
has hashpend =>( |
|
26
|
|
|
|
|
|
|
isa => HashRef, |
|
27
|
|
|
|
|
|
|
traits =>['Hash'], |
|
28
|
|
|
|
|
|
|
clearer => 'clear_hashpend', |
|
29
|
|
|
|
|
|
|
predicate => 'has_hashpend', |
|
30
|
|
|
|
|
|
|
reader => 'get_all_hashpend', |
|
31
|
|
|
|
|
|
|
handles =>{ |
|
32
|
|
|
|
|
|
|
add_to_hashpend => 'set', |
|
33
|
|
|
|
|
|
|
remove_from_hashpend => 'delete', |
|
34
|
|
|
|
|
|
|
}, |
|
35
|
|
|
|
|
|
|
); |
|
36
|
|
|
|
|
|
|
|
|
37
|
|
|
|
|
|
|
has prepend =>( |
|
38
|
|
|
|
|
|
|
isa => ArrayRef, |
|
39
|
|
|
|
|
|
|
traits =>['Array'], |
|
40
|
|
|
|
|
|
|
clearer => 'clear_prepend', |
|
41
|
|
|
|
|
|
|
predicate => 'has_prepend', |
|
42
|
|
|
|
|
|
|
reader => 'get_all_prepend', |
|
43
|
|
|
|
|
|
|
handles =>{ |
|
44
|
|
|
|
|
|
|
add_to_prepend => 'push', |
|
45
|
|
|
|
|
|
|
}, |
|
46
|
|
|
|
|
|
|
); |
|
47
|
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
has postpend =>( |
|
49
|
|
|
|
|
|
|
isa => ArrayRef, |
|
50
|
|
|
|
|
|
|
traits =>['Array'], |
|
51
|
|
|
|
|
|
|
clearer => 'clear_postpend', |
|
52
|
|
|
|
|
|
|
predicate => 'has_postpend', |
|
53
|
|
|
|
|
|
|
reader => 'get_all_postpend', |
|
54
|
|
|
|
|
|
|
handles =>{ |
|
55
|
|
|
|
|
|
|
add_to_postpend => 'push', |
|
56
|
|
|
|
|
|
|
}, |
|
57
|
|
|
|
|
|
|
); |
|
58
|
|
|
|
|
|
|
|
|
59
|
|
|
|
|
|
|
has post_sub =>( |
|
60
|
|
|
|
|
|
|
isa => CodeRef, |
|
61
|
|
|
|
|
|
|
clearer => 'clear_post_sub', |
|
62
|
|
|
|
|
|
|
predicate => 'has_post_sub', |
|
63
|
|
|
|
|
|
|
reader => 'get_post_sub', |
|
64
|
|
|
|
|
|
|
writer => 'set_post_sub', |
|
65
|
|
|
|
|
|
|
); |
|
66
|
|
|
|
|
|
|
|
|
67
|
|
|
|
|
|
|
#########1 Public Methods 3#########4#########5#########6#########7#########8#########9 |
|
68
|
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
sub manage_message{ |
|
70
|
|
|
|
|
|
|
|
|
71
|
4
|
|
|
4
|
1
|
5
|
my ( $self, $message_ref ) = @_; |
|
72
|
|
|
|
|
|
|
###InternalReporTMetaMessagE $switchboard->master_talk( { report => 'log_file', level => 2, |
|
73
|
|
|
|
|
|
|
###InternalReporTMetaMessagE name_space => 'Log::Shiras::Report::MetaMessage::manage_message', |
|
74
|
|
|
|
|
|
|
###InternalReporTMetaMessagE message =>[ 'Updating the message ref:', $message_ref ], } ); |
|
75
|
|
|
|
|
|
|
|
|
76
|
|
|
|
|
|
|
# Handle pre_sub |
|
77
|
4
|
100
|
|
|
|
75
|
if( $self->has_pre_sub ){ |
|
78
|
1
|
|
|
|
|
19
|
my $subref = $self->get_pre_sub; |
|
79
|
|
|
|
|
|
|
###InternalReporTMetaMessagE $switchboard->master_talk( { report => 'log_file', level => 1, |
|
80
|
|
|
|
|
|
|
###InternalReporTMetaMessagE name_space => 'Log::Shiras::Report::MetaMessage::manage_message', |
|
81
|
|
|
|
|
|
|
###InternalReporTMetaMessagE message =>[ 'Handling the pre_sub now' ], } ); |
|
82
|
1
|
|
|
|
|
3
|
$subref->( $message_ref ); |
|
83
|
|
|
|
|
|
|
} |
|
84
|
|
|
|
|
|
|
###InternalReporTMetaMessagE $switchboard->master_talk( { report => 'log_file', level => 1, |
|
85
|
|
|
|
|
|
|
###InternalReporTMetaMessagE name_space => 'Log::Shiras::Report::MetaMessage::manage_message', |
|
86
|
|
|
|
|
|
|
###InternalReporTMetaMessagE message =>[ 'Update message:', $message_ref->{message} ], } ); |
|
87
|
|
|
|
|
|
|
|
|
88
|
|
|
|
|
|
|
# Handle hashpend |
|
89
|
4
|
100
|
|
|
|
109
|
if( $self->has_hashpend ){ |
|
90
|
2
|
|
|
|
|
40
|
my $hashpend_ref = $self->get_all_hashpend; |
|
91
|
|
|
|
|
|
|
###InternalReporTMetaMessagE $switchboard->master_talk( { report => 'log_file', level => 1, |
|
92
|
|
|
|
|
|
|
###InternalReporTMetaMessagE name_space => 'Log::Shiras::Report::MetaMessage::manage_message', |
|
93
|
|
|
|
|
|
|
###InternalReporTMetaMessagE message =>[ 'Handling the hashpend values now:', $hashpend_ref ], } ); |
|
94
|
2
|
50
|
|
|
|
11
|
confess "The first element of the value (array ref) for the message key was not a hash ref" if !is_HashRef( $message_ref->{message}->[0] ); |
|
95
|
2
|
|
|
|
|
229
|
for my $element ( keys %$hashpend_ref ){ |
|
96
|
|
|
|
|
|
|
###InternalReporTMetaMessagE $switchboard->master_talk( { report => 'log_file', level => 0, |
|
97
|
|
|
|
|
|
|
###InternalReporTMetaMessagE name_space => 'Log::Shiras::Report::MetaMessage::manage_message', |
|
98
|
|
|
|
|
|
|
###InternalReporTMetaMessagE message =>[ "Handling the hashpend key -$element- with value: $hashpend_ref->{$element}" ], } ); |
|
99
|
|
|
|
|
|
|
$message_ref->{message}->[0]->{$element} = |
|
100
|
|
|
|
|
|
|
is_CodeRef( $hashpend_ref->{$element} ) ? $hashpend_ref->{$element}->( $message_ref ) : |
|
101
|
|
|
|
|
|
|
exists $message_ref->{$hashpend_ref->{$element}} ? $message_ref->{$hashpend_ref->{$element}} : |
|
102
|
2
|
0
|
|
|
|
5
|
$hashpend_ref->{$element} ; |
|
|
|
50
|
|
|
|
|
|
|
103
|
|
|
|
|
|
|
} |
|
104
|
|
|
|
|
|
|
} |
|
105
|
|
|
|
|
|
|
###InternalReporTMetaMessagE $switchboard->master_talk( { report => 'log_file', level => 1, |
|
106
|
|
|
|
|
|
|
###InternalReporTMetaMessagE name_space => 'Log::Shiras::Report::MetaMessage::manage_message', |
|
107
|
|
|
|
|
|
|
###InternalReporTMetaMessagE message =>[ 'Update message:', $message_ref->{message} ], } ); |
|
108
|
|
|
|
|
|
|
|
|
109
|
|
|
|
|
|
|
# Handle prepend |
|
110
|
4
|
100
|
|
|
|
319
|
if( $self->has_prepend ){ |
|
111
|
2
|
|
|
|
|
37
|
my $prepend_ref = $self->get_all_prepend; |
|
112
|
|
|
|
|
|
|
###InternalReporTMetaMessagE $switchboard->master_talk( { report => 'log_file', level => 1, |
|
113
|
|
|
|
|
|
|
###InternalReporTMetaMessagE name_space => 'Log::Shiras::Report::MetaMessage::manage_message', |
|
114
|
|
|
|
|
|
|
###InternalReporTMetaMessagE message =>[ 'Handling the prepend values now:', $prepend_ref ], } ); |
|
115
|
2
|
|
|
|
|
4
|
for my $element ( reverse @$prepend_ref ){ |
|
116
|
|
|
|
|
|
|
###InternalReporTMetaMessagE $switchboard->master_talk( { report => 'log_file', level => 0, |
|
117
|
|
|
|
|
|
|
###InternalReporTMetaMessagE name_space => 'Log::Shiras::Report::MetaMessage::manage_message', |
|
118
|
|
|
|
|
|
|
###InternalReporTMetaMessagE message =>[ "Handling the prepend value: $element" ], } ); |
|
119
|
4
|
|
|
|
|
12
|
unshift @{$message_ref->{message}}, ( |
|
120
|
4
|
50
|
|
|
|
3
|
exists $message_ref->{$element} ? $message_ref->{$element} : |
|
121
|
|
|
|
|
|
|
$element ); |
|
122
|
|
|
|
|
|
|
} |
|
123
|
|
|
|
|
|
|
} |
|
124
|
|
|
|
|
|
|
###InternalReporTMetaMessagE $switchboard->master_talk( { report => 'log_file', level => 1, |
|
125
|
|
|
|
|
|
|
###InternalReporTMetaMessagE name_space => 'Log::Shiras::Report::MetaMessage::manage_message', |
|
126
|
|
|
|
|
|
|
###InternalReporTMetaMessagE message =>[ 'Update message:', $message_ref->{message} ], } ); |
|
127
|
|
|
|
|
|
|
|
|
128
|
|
|
|
|
|
|
# Handle postpend |
|
129
|
4
|
100
|
|
|
|
75
|
if( $self->has_postpend ){ |
|
130
|
2
|
|
|
|
|
36
|
my $postpend_ref = $self->get_all_postpend; |
|
131
|
|
|
|
|
|
|
###InternalReporTMetaMessagE $switchboard->master_talk( { report => 'log_file', level => 1, |
|
132
|
|
|
|
|
|
|
###InternalReporTMetaMessagE name_space => 'Log::Shiras::Report::MetaMessage::manage_message', |
|
133
|
|
|
|
|
|
|
###InternalReporTMetaMessagE message =>[ 'Handling the postpend values now:', $postpend_ref ], } ); |
|
134
|
2
|
|
|
|
|
3
|
for my $element ( @$postpend_ref ){ |
|
135
|
|
|
|
|
|
|
###InternalReporTMetaMessagE $switchboard->master_talk( { report => 'log_file', level => 0, |
|
136
|
|
|
|
|
|
|
###InternalReporTMetaMessagE name_space => 'Log::Shiras::Report::MetaMessage::manage_message', |
|
137
|
|
|
|
|
|
|
###InternalReporTMetaMessagE message =>[ "Handling the postepend value: $element" ], } ); |
|
138
|
4
|
|
|
|
|
11
|
push @{$message_ref->{message}}, ( |
|
139
|
4
|
100
|
|
|
|
4
|
exists $message_ref->{$element} ? $message_ref->{$element} : |
|
140
|
|
|
|
|
|
|
$element ); |
|
141
|
|
|
|
|
|
|
} |
|
142
|
|
|
|
|
|
|
} |
|
143
|
|
|
|
|
|
|
|
|
144
|
|
|
|
|
|
|
# Handle post_sub |
|
145
|
4
|
100
|
|
|
|
71
|
if( $self->has_post_sub ){ |
|
146
|
1
|
|
|
|
|
19
|
my $subref = $self->get_post_sub; |
|
147
|
|
|
|
|
|
|
###InternalReporTMetaMessagE $switchboard->master_talk( { report => 'log_file', level => 1, |
|
148
|
|
|
|
|
|
|
###InternalReporTMetaMessagE name_space => 'Log::Shiras::Report::MetaMessage::manage_message', |
|
149
|
|
|
|
|
|
|
###InternalReporTMetaMessagE message =>[ 'Handling the post_sub now' ], } ); |
|
150
|
1
|
|
|
|
|
3
|
$subref->( $message_ref ); |
|
151
|
|
|
|
|
|
|
} |
|
152
|
|
|
|
|
|
|
###InternalReporTMetaMessagE $switchboard->master_talk( { report => 'log_file', level => 1, |
|
153
|
|
|
|
|
|
|
###InternalReporTMetaMessagE name_space => 'Log::Shiras::Report::MetaMessage::manage_message', |
|
154
|
|
|
|
|
|
|
###InternalReporTMetaMessagE message =>[ 'Update message:', $message_ref->{message} ], } ); |
|
155
|
|
|
|
|
|
|
|
|
156
|
|
|
|
|
|
|
###InternalReporTMetaMessagE $switchboard->master_talk( { report => 'log_file', level => 3, |
|
157
|
|
|
|
|
|
|
###InternalReporTMetaMessagE name_space => 'Log::Shiras::Report::MetaMessage::manage_message', |
|
158
|
|
|
|
|
|
|
###InternalReporTMetaMessagE message =>[ "Updated full message:", $message_ref ], } ); |
|
159
|
4
|
|
|
|
|
20
|
return $message_ref; |
|
160
|
|
|
|
|
|
|
} |
|
161
|
|
|
|
|
|
|
|
|
162
|
|
|
|
|
|
|
#########1 Private Attributes 3#########4#########5#########6#########7#########8#########9 |
|
163
|
|
|
|
|
|
|
|
|
164
|
|
|
|
|
|
|
|
|
165
|
|
|
|
|
|
|
|
|
166
|
|
|
|
|
|
|
#########1 Private Methods 3#########4#########5#########6#########7#########8#########9 |
|
167
|
|
|
|
|
|
|
|
|
168
|
|
|
|
|
|
|
|
|
169
|
|
|
|
|
|
|
|
|
170
|
|
|
|
|
|
|
#########1 Phinish 3#########4#########5#########6#########7#########8#########9 |
|
171
|
|
|
|
|
|
|
|
|
172
|
1
|
|
|
1
|
|
5
|
no Moose::Role; |
|
|
1
|
|
|
|
|
1
|
|
|
|
1
|
|
|
|
|
4
|
|
|
173
|
|
|
|
|
|
|
|
|
174
|
|
|
|
|
|
|
1; |
|
175
|
|
|
|
|
|
|
# The preceding line will help the module return a true value |
|
176
|
|
|
|
|
|
|
|
|
177
|
|
|
|
|
|
|
#########1 main pod docs 3#########4#########5#########6#########7#########8#########9 |
|
178
|
|
|
|
|
|
|
|
|
179
|
|
|
|
|
|
|
__END__ |
|
180
|
|
|
|
|
|
|
|
|
181
|
|
|
|
|
|
|
=head1 NAME |
|
182
|
|
|
|
|
|
|
|
|
183
|
|
|
|
|
|
|
Log::Shiras::Report::MetaMessage - Add data to messages for reports |
|
184
|
|
|
|
|
|
|
|
|
185
|
|
|
|
|
|
|
=head1 SYNOPSIS |
|
186
|
|
|
|
|
|
|
|
|
187
|
|
|
|
|
|
|
use MooseX::ShortCut::BuildInstance qw( build_class ); |
|
188
|
|
|
|
|
|
|
use Log::Shiras::Report; |
|
189
|
|
|
|
|
|
|
use Log::Shiras::Report::MetaMessage; |
|
190
|
|
|
|
|
|
|
use Data::Dumper; |
|
191
|
|
|
|
|
|
|
my $message_class = build_class( |
|
192
|
|
|
|
|
|
|
package => 'Test', |
|
193
|
|
|
|
|
|
|
add_roles_in_sequence => [ |
|
194
|
|
|
|
|
|
|
'Log::Shiras::Report', |
|
195
|
|
|
|
|
|
|
'Log::Shiras::Report::MetaMessage', |
|
196
|
|
|
|
|
|
|
], |
|
197
|
|
|
|
|
|
|
add_methods =>{ |
|
198
|
|
|
|
|
|
|
add_line => sub{ |
|
199
|
|
|
|
|
|
|
my( $self, $message ) = @_; |
|
200
|
|
|
|
|
|
|
print Dumper( $message->{message} ); |
|
201
|
|
|
|
|
|
|
return 1; |
|
202
|
|
|
|
|
|
|
}, |
|
203
|
|
|
|
|
|
|
} |
|
204
|
|
|
|
|
|
|
); |
|
205
|
|
|
|
|
|
|
my $message_instance = $message_class->new( |
|
206
|
|
|
|
|
|
|
prepend =>[qw( lets go )], |
|
207
|
|
|
|
|
|
|
postpend =>[qw( store package )], |
|
208
|
|
|
|
|
|
|
); |
|
209
|
|
|
|
|
|
|
$message_instance->add_line({ message =>[qw( to the )], package => 'here', }); |
|
210
|
|
|
|
|
|
|
|
|
211
|
|
|
|
|
|
|
####################################################################################### |
|
212
|
|
|
|
|
|
|
# Synopsis output to this point |
|
213
|
|
|
|
|
|
|
# 01: $VAR1 = [ |
|
214
|
|
|
|
|
|
|
# 02: 'lets', |
|
215
|
|
|
|
|
|
|
# 03: 'go', |
|
216
|
|
|
|
|
|
|
# 04: 'to', |
|
217
|
|
|
|
|
|
|
# 05: 'the', |
|
218
|
|
|
|
|
|
|
# 06: 'store', |
|
219
|
|
|
|
|
|
|
# 07: 'here' |
|
220
|
|
|
|
|
|
|
# 08: ]; |
|
221
|
|
|
|
|
|
|
####################################################################################### |
|
222
|
|
|
|
|
|
|
|
|
223
|
|
|
|
|
|
|
$message_instance->set_post_sub( |
|
224
|
|
|
|
|
|
|
sub{ |
|
225
|
|
|
|
|
|
|
my $message = $_[0]; |
|
226
|
|
|
|
|
|
|
my $new_ref; |
|
227
|
|
|
|
|
|
|
for my $element ( @{$message->{message}} ){ |
|
228
|
|
|
|
|
|
|
push @$new_ref, uc( $element ); |
|
229
|
|
|
|
|
|
|
} |
|
230
|
|
|
|
|
|
|
$message->{message} = $new_ref; |
|
231
|
|
|
|
|
|
|
} |
|
232
|
|
|
|
|
|
|
); |
|
233
|
|
|
|
|
|
|
$message_instance->add_line({ message =>[qw( from the )], package => 'here', }); |
|
234
|
|
|
|
|
|
|
|
|
235
|
|
|
|
|
|
|
####################################################################################### |
|
236
|
|
|
|
|
|
|
# Synopsis output addition to this point |
|
237
|
|
|
|
|
|
|
# 01: $VAR1 = [ |
|
238
|
|
|
|
|
|
|
# 02: 'LETS', |
|
239
|
|
|
|
|
|
|
# 03: 'GO', |
|
240
|
|
|
|
|
|
|
# 04: 'FROM', |
|
241
|
|
|
|
|
|
|
# 05: 'THE', |
|
242
|
|
|
|
|
|
|
# 06: 'STORE', |
|
243
|
|
|
|
|
|
|
# 07: 'HERE' |
|
244
|
|
|
|
|
|
|
# 08: ]; |
|
245
|
|
|
|
|
|
|
####################################################################################### |
|
246
|
|
|
|
|
|
|
|
|
247
|
|
|
|
|
|
|
$message_instance = $message_class->new( |
|
248
|
|
|
|
|
|
|
hashpend => { |
|
249
|
|
|
|
|
|
|
locate_jenny => sub{ |
|
250
|
|
|
|
|
|
|
my $message = $_[0]; |
|
251
|
|
|
|
|
|
|
my $answer; |
|
252
|
|
|
|
|
|
|
for my $person ( keys %{$message->{message}->[0]} ){ |
|
253
|
|
|
|
|
|
|
if( $person eq 'Jenny' ){ |
|
254
|
|
|
|
|
|
|
$answer = "$person lives in: $message->{message}->[0]->{$person}" ; |
|
255
|
|
|
|
|
|
|
last; |
|
256
|
|
|
|
|
|
|
} |
|
257
|
|
|
|
|
|
|
} |
|
258
|
|
|
|
|
|
|
return $answer; |
|
259
|
|
|
|
|
|
|
} |
|
260
|
|
|
|
|
|
|
}, |
|
261
|
|
|
|
|
|
|
); |
|
262
|
|
|
|
|
|
|
$message_instance->add_line({ message =>[{ |
|
263
|
|
|
|
|
|
|
Frank => 'San Fransisco', |
|
264
|
|
|
|
|
|
|
Donna => 'Carbondale', |
|
265
|
|
|
|
|
|
|
Jenny => 'Portland' }], }); |
|
266
|
|
|
|
|
|
|
|
|
267
|
|
|
|
|
|
|
####################################################################################### |
|
268
|
|
|
|
|
|
|
# Synopsis output addition to this point |
|
269
|
|
|
|
|
|
|
# 01: $VAR1 = [ |
|
270
|
|
|
|
|
|
|
# 02: { |
|
271
|
|
|
|
|
|
|
# 03: 'locate_jenny' => 'Jenny lives in: Portland', |
|
272
|
|
|
|
|
|
|
# 04: 'Donna' => 'Carbondale', |
|
273
|
|
|
|
|
|
|
# 05: 'Jenny' => 'Portland', |
|
274
|
|
|
|
|
|
|
# 06: 'Frank' => 'San Fransisco' |
|
275
|
|
|
|
|
|
|
# 07: } |
|
276
|
|
|
|
|
|
|
# 08: ]; |
|
277
|
|
|
|
|
|
|
####################################################################################### |
|
278
|
|
|
|
|
|
|
|
|
279
|
|
|
|
|
|
|
$message_instance->set_pre_sub( |
|
280
|
|
|
|
|
|
|
sub{ |
|
281
|
|
|
|
|
|
|
my $message = $_[0]; |
|
282
|
|
|
|
|
|
|
my $lookup = { |
|
283
|
|
|
|
|
|
|
'San Fransisco' => 'CA', |
|
284
|
|
|
|
|
|
|
'Carbondale' => 'IL', |
|
285
|
|
|
|
|
|
|
'Portland' => 'OR', |
|
286
|
|
|
|
|
|
|
}; |
|
287
|
|
|
|
|
|
|
for my $element ( keys %{$message->{message}->[0]} ){ |
|
288
|
|
|
|
|
|
|
$message->{message}->[0]->{$element} .= |
|
289
|
|
|
|
|
|
|
', ' . $lookup->{$message->{message}->[0]->{$element}}; |
|
290
|
|
|
|
|
|
|
} |
|
291
|
|
|
|
|
|
|
} |
|
292
|
|
|
|
|
|
|
); |
|
293
|
|
|
|
|
|
|
$message_instance->add_line({ message =>[{ |
|
294
|
|
|
|
|
|
|
Frank => 'San Fransisco', |
|
295
|
|
|
|
|
|
|
Donna => 'Carbondale', |
|
296
|
|
|
|
|
|
|
Jenny => 'Portland' }], }); |
|
297
|
|
|
|
|
|
|
|
|
298
|
|
|
|
|
|
|
####################################################################################### |
|
299
|
|
|
|
|
|
|
# Synopsis output addition to this point |
|
300
|
|
|
|
|
|
|
# 01: $VAR1 = [ |
|
301
|
|
|
|
|
|
|
# 02: { |
|
302
|
|
|
|
|
|
|
# 03: 'locate_jenny' => 'Jenny lives in: Portland, OR', |
|
303
|
|
|
|
|
|
|
# 04: 'Donna' => 'Carbondale, IL', |
|
304
|
|
|
|
|
|
|
# 05: 'Jenny' => 'Portland, OR', |
|
305
|
|
|
|
|
|
|
# 06: 'Frank' => 'San Fransisco, CA' |
|
306
|
|
|
|
|
|
|
# 07: } |
|
307
|
|
|
|
|
|
|
# 08: ]; |
|
308
|
|
|
|
|
|
|
####################################################################################### |
|
309
|
|
|
|
|
|
|
|
|
310
|
|
|
|
|
|
|
=head1 DESCRIPTION |
|
311
|
|
|
|
|
|
|
|
|
312
|
|
|
|
|
|
|
This is Moose role that can be used by L<Log::Shiras::Report> to massage the message prior |
|
313
|
|
|
|
|
|
|
to 'add_line' being implemented in the report. It uses the hook built in the to Report |
|
314
|
|
|
|
|
|
|
role for the method 'manage_message'. |
|
315
|
|
|
|
|
|
|
|
|
316
|
|
|
|
|
|
|
There are five ways to affect the passed message ref. Each way is set up as an L<attribute |
|
317
|
|
|
|
|
|
|
|/Attributes> of the class. Details of how each is implemented is explained in the |
|
318
|
|
|
|
|
|
|
Attributes section. |
|
319
|
|
|
|
|
|
|
|
|
320
|
|
|
|
|
|
|
=head2 Warning |
|
321
|
|
|
|
|
|
|
|
|
322
|
|
|
|
|
|
|
'hashpend' and 'prepend' - 'postpend' can conflict since 'hashpend' acts on the first |
|
323
|
|
|
|
|
|
|
message element as if it were a hashref and the next two act as if the message is a list. |
|
324
|
|
|
|
|
|
|
A good rule of thumb is to not use both sets together unless you really know what is going |
|
325
|
|
|
|
|
|
|
on. |
|
326
|
|
|
|
|
|
|
|
|
327
|
|
|
|
|
|
|
=head2 Attributes |
|
328
|
|
|
|
|
|
|
|
|
329
|
|
|
|
|
|
|
Data passed to ->new when creating an instance. For modification of these attributes |
|
330
|
|
|
|
|
|
|
after the instance is created see the attribute methods. |
|
331
|
|
|
|
|
|
|
|
|
332
|
|
|
|
|
|
|
=head3 pre_sub |
|
333
|
|
|
|
|
|
|
|
|
334
|
|
|
|
|
|
|
=over |
|
335
|
|
|
|
|
|
|
|
|
336
|
|
|
|
|
|
|
B<Definition:> This is a place to store a perl closure that will be passed the full |
|
337
|
|
|
|
|
|
|
$message_ref including meta data. The results of the closure are not used so any |
|
338
|
|
|
|
|
|
|
desired change should be done to the $message_ref itself since it is persistent. The |
|
339
|
|
|
|
|
|
|
action takes place before all the other attributes are implemented so the changes will |
|
340
|
|
|
|
|
|
|
NOT be available to process. See the example in the SYNOPSIS. |
|
341
|
|
|
|
|
|
|
|
|
342
|
|
|
|
|
|
|
B<Default:> None |
|
343
|
|
|
|
|
|
|
|
|
344
|
|
|
|
|
|
|
B<Required:> No |
|
345
|
|
|
|
|
|
|
|
|
346
|
|
|
|
|
|
|
B<Range:> it must pass the is_CodeRef test |
|
347
|
|
|
|
|
|
|
|
|
348
|
|
|
|
|
|
|
B<attribute methods> |
|
349
|
|
|
|
|
|
|
|
|
350
|
|
|
|
|
|
|
=over |
|
351
|
|
|
|
|
|
|
|
|
352
|
|
|
|
|
|
|
B<clear_pre_sub> |
|
353
|
|
|
|
|
|
|
|
|
354
|
|
|
|
|
|
|
=over |
|
355
|
|
|
|
|
|
|
|
|
356
|
|
|
|
|
|
|
B<Description> removes the stored attribute value |
|
357
|
|
|
|
|
|
|
|
|
358
|
|
|
|
|
|
|
=back |
|
359
|
|
|
|
|
|
|
|
|
360
|
|
|
|
|
|
|
B<has_pre_sub> |
|
361
|
|
|
|
|
|
|
|
|
362
|
|
|
|
|
|
|
=over |
|
363
|
|
|
|
|
|
|
|
|
364
|
|
|
|
|
|
|
B<Description> predicate for the attribute |
|
365
|
|
|
|
|
|
|
|
|
366
|
|
|
|
|
|
|
=back |
|
367
|
|
|
|
|
|
|
|
|
368
|
|
|
|
|
|
|
B<get_pre_sub> |
|
369
|
|
|
|
|
|
|
|
|
370
|
|
|
|
|
|
|
=over |
|
371
|
|
|
|
|
|
|
|
|
372
|
|
|
|
|
|
|
B<Description> returns the attribute value |
|
373
|
|
|
|
|
|
|
|
|
374
|
|
|
|
|
|
|
=back |
|
375
|
|
|
|
|
|
|
|
|
376
|
|
|
|
|
|
|
B<set_pre_sub( $closure )> |
|
377
|
|
|
|
|
|
|
|
|
378
|
|
|
|
|
|
|
=over |
|
379
|
|
|
|
|
|
|
|
|
380
|
|
|
|
|
|
|
B<Description> sets the attribute value |
|
381
|
|
|
|
|
|
|
|
|
382
|
|
|
|
|
|
|
=back |
|
383
|
|
|
|
|
|
|
|
|
384
|
|
|
|
|
|
|
=back |
|
385
|
|
|
|
|
|
|
|
|
386
|
|
|
|
|
|
|
=back |
|
387
|
|
|
|
|
|
|
|
|
388
|
|
|
|
|
|
|
=head3 hashpend |
|
389
|
|
|
|
|
|
|
|
|
390
|
|
|
|
|
|
|
=over |
|
391
|
|
|
|
|
|
|
|
|
392
|
|
|
|
|
|
|
B<Definition:> This will update the position %{$message_ref->{message}->[0]}. If |
|
393
|
|
|
|
|
|
|
that position is not a hash ref then. It will kill the process with L<Carp> - |
|
394
|
|
|
|
|
|
|
confess. After it passes that test it will perform the following assuming the |
|
395
|
|
|
|
|
|
|
attribute is retrieved as $hashpend_ref and the entire message is passed as |
|
396
|
|
|
|
|
|
|
$message_ref; |
|
397
|
|
|
|
|
|
|
|
|
398
|
|
|
|
|
|
|
for my $element ( keys %$hashpend_ref ){ |
|
399
|
|
|
|
|
|
|
$message_ref->{message}->[0]->{$element} = |
|
400
|
|
|
|
|
|
|
is_CodeRef( $hashpend_ref->{$element} ) ? |
|
401
|
|
|
|
|
|
|
$hashpend_ref->{$element}->( $message_ref ) : |
|
402
|
|
|
|
|
|
|
exists $message_ref->{$hashpend_ref->{$element}} ? |
|
403
|
|
|
|
|
|
|
$message_ref->{$hashpend_ref->{$element}} : |
|
404
|
|
|
|
|
|
|
$hashpend_ref->{$element} ; |
|
405
|
|
|
|
|
|
|
} |
|
406
|
|
|
|
|
|
|
|
|
407
|
|
|
|
|
|
|
This means that if the value of the $element is a closure then it will use the results |
|
408
|
|
|
|
|
|
|
of that and add that to the message sub-hashref. Otherwise it will attempt to pull |
|
409
|
|
|
|
|
|
|
the equivalent key from the $message meta-data and add it to the message sub-hashref or |
|
410
|
|
|
|
|
|
|
if all else fails just load the key value pair as it stands to the message sub-hashref. |
|
411
|
|
|
|
|
|
|
|
|
412
|
|
|
|
|
|
|
B<Default:> None |
|
413
|
|
|
|
|
|
|
|
|
414
|
|
|
|
|
|
|
B<Required:> No |
|
415
|
|
|
|
|
|
|
|
|
416
|
|
|
|
|
|
|
B<Range:> it must be a hashref |
|
417
|
|
|
|
|
|
|
|
|
418
|
|
|
|
|
|
|
B<attribute methods> |
|
419
|
|
|
|
|
|
|
|
|
420
|
|
|
|
|
|
|
=over |
|
421
|
|
|
|
|
|
|
|
|
422
|
|
|
|
|
|
|
B<clear_hashpend> |
|
423
|
|
|
|
|
|
|
|
|
424
|
|
|
|
|
|
|
=over |
|
425
|
|
|
|
|
|
|
|
|
426
|
|
|
|
|
|
|
B<Description> removes the stored attribute value |
|
427
|
|
|
|
|
|
|
|
|
428
|
|
|
|
|
|
|
=back |
|
429
|
|
|
|
|
|
|
|
|
430
|
|
|
|
|
|
|
B<has_hashpend> |
|
431
|
|
|
|
|
|
|
|
|
432
|
|
|
|
|
|
|
=over |
|
433
|
|
|
|
|
|
|
|
|
434
|
|
|
|
|
|
|
B<Description> predicate for the attribute |
|
435
|
|
|
|
|
|
|
|
|
436
|
|
|
|
|
|
|
=back |
|
437
|
|
|
|
|
|
|
|
|
438
|
|
|
|
|
|
|
B<get_all_hashpend> |
|
439
|
|
|
|
|
|
|
|
|
440
|
|
|
|
|
|
|
=over |
|
441
|
|
|
|
|
|
|
|
|
442
|
|
|
|
|
|
|
B<Description> returns the attribute value |
|
443
|
|
|
|
|
|
|
|
|
444
|
|
|
|
|
|
|
=back |
|
445
|
|
|
|
|
|
|
|
|
446
|
|
|
|
|
|
|
B<add_to_hashpend( $key => $value|$closure )> |
|
447
|
|
|
|
|
|
|
|
|
448
|
|
|
|
|
|
|
=over |
|
449
|
|
|
|
|
|
|
|
|
450
|
|
|
|
|
|
|
B<Description> this adds to the attribute and can accept more than one $key => $value pair |
|
451
|
|
|
|
|
|
|
|
|
452
|
|
|
|
|
|
|
=back |
|
453
|
|
|
|
|
|
|
|
|
454
|
|
|
|
|
|
|
B<remove_from_hashpend( $key )> |
|
455
|
|
|
|
|
|
|
|
|
456
|
|
|
|
|
|
|
=over |
|
457
|
|
|
|
|
|
|
|
|
458
|
|
|
|
|
|
|
B<Description> removes the $key => $value pair associated with the passed $key from the |
|
459
|
|
|
|
|
|
|
hashpend. This can accept more than one key at a time. |
|
460
|
|
|
|
|
|
|
|
|
461
|
|
|
|
|
|
|
=back |
|
462
|
|
|
|
|
|
|
|
|
463
|
|
|
|
|
|
|
=back |
|
464
|
|
|
|
|
|
|
|
|
465
|
|
|
|
|
|
|
=back |
|
466
|
|
|
|
|
|
|
|
|
467
|
|
|
|
|
|
|
=head3 prepend |
|
468
|
|
|
|
|
|
|
|
|
469
|
|
|
|
|
|
|
=over |
|
470
|
|
|
|
|
|
|
|
|
471
|
|
|
|
|
|
|
B<Definition:> This will push elements to the beginning of the list |
|
472
|
|
|
|
|
|
|
@{$message_ref->{message}}. The elements are pushed in the reverse order that they are |
|
473
|
|
|
|
|
|
|
stored in this attribute meaning that they will wind up in the stored order in the message |
|
474
|
|
|
|
|
|
|
ref. The action assumes that |
|
475
|
|
|
|
|
|
|
the attribute is retrieved as $prepend_ref and the entire message is passed as |
|
476
|
|
|
|
|
|
|
$message_ref; |
|
477
|
|
|
|
|
|
|
|
|
478
|
|
|
|
|
|
|
for my $element ( reverse @$prepend_ref ){ |
|
479
|
|
|
|
|
|
|
unshift @{$message_ref->{message}}, ( |
|
480
|
|
|
|
|
|
|
exists $message_ref->{$element} ? $message_ref->{$element} : |
|
481
|
|
|
|
|
|
|
$element ); |
|
482
|
|
|
|
|
|
|
} |
|
483
|
|
|
|
|
|
|
|
|
484
|
|
|
|
|
|
|
Unlike the hashpend attribute it will not handle CodeRefs. |
|
485
|
|
|
|
|
|
|
|
|
486
|
|
|
|
|
|
|
B<Default:> None |
|
487
|
|
|
|
|
|
|
|
|
488
|
|
|
|
|
|
|
B<Required:> No |
|
489
|
|
|
|
|
|
|
|
|
490
|
|
|
|
|
|
|
B<Range:> it must be an arrayref |
|
491
|
|
|
|
|
|
|
|
|
492
|
|
|
|
|
|
|
B<attribute methods> |
|
493
|
|
|
|
|
|
|
|
|
494
|
|
|
|
|
|
|
=over |
|
495
|
|
|
|
|
|
|
|
|
496
|
|
|
|
|
|
|
B<clear_prepend> |
|
497
|
|
|
|
|
|
|
|
|
498
|
|
|
|
|
|
|
=over |
|
499
|
|
|
|
|
|
|
|
|
500
|
|
|
|
|
|
|
B<Description> removes the stored attribute value |
|
501
|
|
|
|
|
|
|
|
|
502
|
|
|
|
|
|
|
=back |
|
503
|
|
|
|
|
|
|
|
|
504
|
|
|
|
|
|
|
B<has_prepend> |
|
505
|
|
|
|
|
|
|
|
|
506
|
|
|
|
|
|
|
=over |
|
507
|
|
|
|
|
|
|
|
|
508
|
|
|
|
|
|
|
B<Description> predicate for the attribute |
|
509
|
|
|
|
|
|
|
|
|
510
|
|
|
|
|
|
|
=back |
|
511
|
|
|
|
|
|
|
|
|
512
|
|
|
|
|
|
|
B<get_all_prepend> |
|
513
|
|
|
|
|
|
|
|
|
514
|
|
|
|
|
|
|
=over |
|
515
|
|
|
|
|
|
|
|
|
516
|
|
|
|
|
|
|
B<Description> returns the attribute value |
|
517
|
|
|
|
|
|
|
|
|
518
|
|
|
|
|
|
|
=back |
|
519
|
|
|
|
|
|
|
|
|
520
|
|
|
|
|
|
|
B<add_to_prepend( $element )> |
|
521
|
|
|
|
|
|
|
|
|
522
|
|
|
|
|
|
|
=over |
|
523
|
|
|
|
|
|
|
|
|
524
|
|
|
|
|
|
|
B<Description> this adds to the end of the attribute and can accept more than one $element |
|
525
|
|
|
|
|
|
|
|
|
526
|
|
|
|
|
|
|
=back |
|
527
|
|
|
|
|
|
|
|
|
528
|
|
|
|
|
|
|
=back |
|
529
|
|
|
|
|
|
|
|
|
530
|
|
|
|
|
|
|
=back |
|
531
|
|
|
|
|
|
|
|
|
532
|
|
|
|
|
|
|
=head3 postpend |
|
533
|
|
|
|
|
|
|
|
|
534
|
|
|
|
|
|
|
=over |
|
535
|
|
|
|
|
|
|
|
|
536
|
|
|
|
|
|
|
B<Definition:> This will push elements to the end of the list @{$message_ref->{message}}. |
|
537
|
|
|
|
|
|
|
The elements are pushed in the order that they are stored in this attribute. The action |
|
538
|
|
|
|
|
|
|
below assumes that the attribute is retrieved as $postpend_ref and the entire message is |
|
539
|
|
|
|
|
|
|
passed as $message_ref; |
|
540
|
|
|
|
|
|
|
|
|
541
|
|
|
|
|
|
|
for my $element ( reverse @$postpend_ref ){ |
|
542
|
|
|
|
|
|
|
push @{$message_ref->{message}}, ( |
|
543
|
|
|
|
|
|
|
exists $message_ref->{$element} ? $message_ref->{$element} : |
|
544
|
|
|
|
|
|
|
$element ); |
|
545
|
|
|
|
|
|
|
} |
|
546
|
|
|
|
|
|
|
|
|
547
|
|
|
|
|
|
|
Unlike the hashpend attribute it will not handle CodeRefs. |
|
548
|
|
|
|
|
|
|
|
|
549
|
|
|
|
|
|
|
B<Default:> None |
|
550
|
|
|
|
|
|
|
|
|
551
|
|
|
|
|
|
|
B<Required:> No |
|
552
|
|
|
|
|
|
|
|
|
553
|
|
|
|
|
|
|
B<Range:> it must be an arrayref |
|
554
|
|
|
|
|
|
|
|
|
555
|
|
|
|
|
|
|
B<attribute methods> |
|
556
|
|
|
|
|
|
|
|
|
557
|
|
|
|
|
|
|
=over |
|
558
|
|
|
|
|
|
|
|
|
559
|
|
|
|
|
|
|
B<clear_postpend> |
|
560
|
|
|
|
|
|
|
|
|
561
|
|
|
|
|
|
|
=over |
|
562
|
|
|
|
|
|
|
|
|
563
|
|
|
|
|
|
|
B<Description> removes the stored attribute value |
|
564
|
|
|
|
|
|
|
|
|
565
|
|
|
|
|
|
|
=back |
|
566
|
|
|
|
|
|
|
|
|
567
|
|
|
|
|
|
|
B<has_postpend> |
|
568
|
|
|
|
|
|
|
|
|
569
|
|
|
|
|
|
|
=over |
|
570
|
|
|
|
|
|
|
|
|
571
|
|
|
|
|
|
|
B<Description> predicate for the attribute |
|
572
|
|
|
|
|
|
|
|
|
573
|
|
|
|
|
|
|
=back |
|
574
|
|
|
|
|
|
|
|
|
575
|
|
|
|
|
|
|
B<get_all_postpend> |
|
576
|
|
|
|
|
|
|
|
|
577
|
|
|
|
|
|
|
=over |
|
578
|
|
|
|
|
|
|
|
|
579
|
|
|
|
|
|
|
B<Description> returns the attribute value |
|
580
|
|
|
|
|
|
|
|
|
581
|
|
|
|
|
|
|
=back |
|
582
|
|
|
|
|
|
|
|
|
583
|
|
|
|
|
|
|
B<add_to_postpend( $element )> |
|
584
|
|
|
|
|
|
|
|
|
585
|
|
|
|
|
|
|
=over |
|
586
|
|
|
|
|
|
|
|
|
587
|
|
|
|
|
|
|
B<Description> this adds to the end of the attribute and can accept more than one $element |
|
588
|
|
|
|
|
|
|
|
|
589
|
|
|
|
|
|
|
=back |
|
590
|
|
|
|
|
|
|
|
|
591
|
|
|
|
|
|
|
=back |
|
592
|
|
|
|
|
|
|
|
|
593
|
|
|
|
|
|
|
=back |
|
594
|
|
|
|
|
|
|
|
|
595
|
|
|
|
|
|
|
=head3 post_sub |
|
596
|
|
|
|
|
|
|
|
|
597
|
|
|
|
|
|
|
=over |
|
598
|
|
|
|
|
|
|
|
|
599
|
|
|
|
|
|
|
B<Definition:> This is a place to store a perl closure that will be passed the full |
|
600
|
|
|
|
|
|
|
$message_ref including meta data. The results of the closure are not used so any |
|
601
|
|
|
|
|
|
|
desired change should be done to the $message_ref itself since it is persistent. The |
|
602
|
|
|
|
|
|
|
action takes place after all the other attributes are implemented so the changes will |
|
603
|
|
|
|
|
|
|
be available to process. See the example in the SYNOPSIS. |
|
604
|
|
|
|
|
|
|
|
|
605
|
|
|
|
|
|
|
B<Default:> None |
|
606
|
|
|
|
|
|
|
|
|
607
|
|
|
|
|
|
|
B<Required:> No |
|
608
|
|
|
|
|
|
|
|
|
609
|
|
|
|
|
|
|
B<Range:> it must pass the is_CodeRef test |
|
610
|
|
|
|
|
|
|
|
|
611
|
|
|
|
|
|
|
B<attribute methods> |
|
612
|
|
|
|
|
|
|
|
|
613
|
|
|
|
|
|
|
=over |
|
614
|
|
|
|
|
|
|
|
|
615
|
|
|
|
|
|
|
B<clear_post_sub> |
|
616
|
|
|
|
|
|
|
|
|
617
|
|
|
|
|
|
|
=over |
|
618
|
|
|
|
|
|
|
|
|
619
|
|
|
|
|
|
|
B<Description> removes the stored attribute value |
|
620
|
|
|
|
|
|
|
|
|
621
|
|
|
|
|
|
|
=back |
|
622
|
|
|
|
|
|
|
|
|
623
|
|
|
|
|
|
|
B<has_post_sub> |
|
624
|
|
|
|
|
|
|
|
|
625
|
|
|
|
|
|
|
=over |
|
626
|
|
|
|
|
|
|
|
|
627
|
|
|
|
|
|
|
B<Description> predicate for the attribute |
|
628
|
|
|
|
|
|
|
|
|
629
|
|
|
|
|
|
|
=back |
|
630
|
|
|
|
|
|
|
|
|
631
|
|
|
|
|
|
|
B<get_post_sub> |
|
632
|
|
|
|
|
|
|
|
|
633
|
|
|
|
|
|
|
=over |
|
634
|
|
|
|
|
|
|
|
|
635
|
|
|
|
|
|
|
B<Description> returns the attribute value |
|
636
|
|
|
|
|
|
|
|
|
637
|
|
|
|
|
|
|
=back |
|
638
|
|
|
|
|
|
|
|
|
639
|
|
|
|
|
|
|
B<set_post_sub( $closure )> |
|
640
|
|
|
|
|
|
|
|
|
641
|
|
|
|
|
|
|
=over |
|
642
|
|
|
|
|
|
|
|
|
643
|
|
|
|
|
|
|
B<Description> sets the attribute value |
|
644
|
|
|
|
|
|
|
|
|
645
|
|
|
|
|
|
|
=back |
|
646
|
|
|
|
|
|
|
|
|
647
|
|
|
|
|
|
|
=back |
|
648
|
|
|
|
|
|
|
|
|
649
|
|
|
|
|
|
|
=back |
|
650
|
|
|
|
|
|
|
|
|
651
|
|
|
|
|
|
|
=head2 Methods |
|
652
|
|
|
|
|
|
|
|
|
653
|
|
|
|
|
|
|
=head3 manage_message( $message_ref ) |
|
654
|
|
|
|
|
|
|
|
|
655
|
|
|
|
|
|
|
=over |
|
656
|
|
|
|
|
|
|
|
|
657
|
|
|
|
|
|
|
B<Definition:> This is a possible method called by L<Log::Shiras::Report> with the |
|
658
|
|
|
|
|
|
|
intent of implementing the L<attributes|/Attributes> on each message passed to a |
|
659
|
|
|
|
|
|
|
L<Log::Shiras::Switchboard/reports>. Actions taken on that message vary from attribute |
|
660
|
|
|
|
|
|
|
to attribute and the specifics are explained in each. The attributes are implemented in |
|
661
|
|
|
|
|
|
|
this order. |
|
662
|
|
|
|
|
|
|
|
|
663
|
|
|
|
|
|
|
pre_sub -> hashpend -> prepend -> postpend -> post_sub |
|
664
|
|
|
|
|
|
|
|
|
665
|
|
|
|
|
|
|
|
|
666
|
|
|
|
|
|
|
B<Returns:> the (updated) $message_ref |
|
667
|
|
|
|
|
|
|
|
|
668
|
|
|
|
|
|
|
=back |
|
669
|
|
|
|
|
|
|
|
|
670
|
|
|
|
|
|
|
=head1 GLOBAL VARIABLES |
|
671
|
|
|
|
|
|
|
|
|
672
|
|
|
|
|
|
|
=over |
|
673
|
|
|
|
|
|
|
|
|
674
|
|
|
|
|
|
|
=item B<$ENV{hide_warn}> |
|
675
|
|
|
|
|
|
|
|
|
676
|
|
|
|
|
|
|
The module will warn when debug lines are 'Unhide'n. In the case where the you |
|
677
|
|
|
|
|
|
|
don't want these notifications set this environmental variable to true. |
|
678
|
|
|
|
|
|
|
|
|
679
|
|
|
|
|
|
|
=back |
|
680
|
|
|
|
|
|
|
|
|
681
|
|
|
|
|
|
|
=head1 SUPPORT |
|
682
|
|
|
|
|
|
|
|
|
683
|
|
|
|
|
|
|
=over |
|
684
|
|
|
|
|
|
|
|
|
685
|
|
|
|
|
|
|
L<Log-Shiras/issues|https://github.com/jandrew/Log-Shiras/issues> |
|
686
|
|
|
|
|
|
|
|
|
687
|
|
|
|
|
|
|
=back |
|
688
|
|
|
|
|
|
|
|
|
689
|
|
|
|
|
|
|
=head1 TODO |
|
690
|
|
|
|
|
|
|
|
|
691
|
|
|
|
|
|
|
=over |
|
692
|
|
|
|
|
|
|
|
|
693
|
|
|
|
|
|
|
B<1.> Nothing L<currently|/SUPPORT> |
|
694
|
|
|
|
|
|
|
|
|
695
|
|
|
|
|
|
|
=back |
|
696
|
|
|
|
|
|
|
|
|
697
|
|
|
|
|
|
|
=head1 AUTHOR |
|
698
|
|
|
|
|
|
|
|
|
699
|
|
|
|
|
|
|
=over |
|
700
|
|
|
|
|
|
|
|
|
701
|
|
|
|
|
|
|
=item Jed Lund |
|
702
|
|
|
|
|
|
|
|
|
703
|
|
|
|
|
|
|
=item jandrew@cpan.org |
|
704
|
|
|
|
|
|
|
|
|
705
|
|
|
|
|
|
|
=back |
|
706
|
|
|
|
|
|
|
|
|
707
|
|
|
|
|
|
|
=head1 COPYRIGHT |
|
708
|
|
|
|
|
|
|
|
|
709
|
|
|
|
|
|
|
This program is free software; you can redistribute |
|
710
|
|
|
|
|
|
|
it and/or modify it under the same terms as Perl itself. |
|
711
|
|
|
|
|
|
|
|
|
712
|
|
|
|
|
|
|
The full text of the license can be found in the |
|
713
|
|
|
|
|
|
|
LICENSE file included with this module. |
|
714
|
|
|
|
|
|
|
|
|
715
|
|
|
|
|
|
|
=head1 DEPENDENCIES |
|
716
|
|
|
|
|
|
|
|
|
717
|
|
|
|
|
|
|
=over |
|
718
|
|
|
|
|
|
|
|
|
719
|
|
|
|
|
|
|
L<perl 5.010|perl/5.10.0> |
|
720
|
|
|
|
|
|
|
|
|
721
|
|
|
|
|
|
|
L<utf8> |
|
722
|
|
|
|
|
|
|
|
|
723
|
|
|
|
|
|
|
L<version> |
|
724
|
|
|
|
|
|
|
|
|
725
|
|
|
|
|
|
|
L<Moose::Role> |
|
726
|
|
|
|
|
|
|
|
|
727
|
|
|
|
|
|
|
L<MooseX::Types::Moose> |
|
728
|
|
|
|
|
|
|
|
|
729
|
|
|
|
|
|
|
L<Carp> - confess |
|
730
|
|
|
|
|
|
|
|
|
731
|
|
|
|
|
|
|
=back |
|
732
|
|
|
|
|
|
|
|
|
733
|
|
|
|
|
|
|
=cut |
|
734
|
|
|
|
|
|
|
|
|
735
|
|
|
|
|
|
|
#########1#########2 main pod documentation end 5#########6#########7#########8#########9 |