line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
########################################################################### |
2
|
|
|
|
|
|
|
# |
3
|
|
|
|
|
|
|
# String.pm |
4
|
|
|
|
|
|
|
# |
5
|
|
|
|
|
|
|
# Copyright (C) 1999 Raphael Manfredi. |
6
|
|
|
|
|
|
|
# Copyright (C) 2002-2017 Mark Rogaski, mrogaski@cpan.org; |
7
|
|
|
|
|
|
|
# all rights reserved. |
8
|
|
|
|
|
|
|
# |
9
|
|
|
|
|
|
|
# See the README file included with the |
10
|
|
|
|
|
|
|
# distribution for license information. |
11
|
|
|
|
|
|
|
# |
12
|
|
|
|
|
|
|
########################################################################## |
13
|
|
|
|
|
|
|
|
14
|
2
|
|
|
2
|
|
457
|
use strict; |
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
94
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
######################################################################## |
17
|
|
|
|
|
|
|
package Log::Agent::Tag::String; |
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
require Log::Agent::Tag; |
20
|
2
|
|
|
2
|
|
11
|
use vars qw(@ISA); |
|
2
|
|
|
|
|
2
|
|
|
2
|
|
|
|
|
432
|
|
21
|
|
|
|
|
|
|
@ISA = qw(Log::Agent::Tag); |
22
|
|
|
|
|
|
|
|
23
|
|
|
|
|
|
|
# |
24
|
|
|
|
|
|
|
# ->make |
25
|
|
|
|
|
|
|
# |
26
|
|
|
|
|
|
|
# Creation routine. |
27
|
|
|
|
|
|
|
# |
28
|
|
|
|
|
|
|
# Calling arguments: a hash table list. |
29
|
|
|
|
|
|
|
# |
30
|
|
|
|
|
|
|
# The keyed argument list may contain: |
31
|
|
|
|
|
|
|
# -POSTFIX whether to postfix log message or prefix it. |
32
|
|
|
|
|
|
|
# -SEPARATOR separator string to use between tag and message |
33
|
|
|
|
|
|
|
# -NAME tag's name (optional) |
34
|
|
|
|
|
|
|
# -VALUE string value to use |
35
|
|
|
|
|
|
|
# |
36
|
|
|
|
|
|
|
# Attributes: |
37
|
|
|
|
|
|
|
# string the string value |
38
|
|
|
|
|
|
|
# |
39
|
|
|
|
|
|
|
sub make { |
40
|
7
|
|
|
7
|
0
|
43
|
my $self = bless {}, shift; |
41
|
7
|
|
|
|
|
23
|
my (%args) = @_; |
42
|
7
|
|
|
|
|
13
|
my ($name, $postfix, $separator, $value); |
43
|
|
|
|
|
|
|
|
44
|
7
|
|
|
|
|
20
|
my %set = ( |
45
|
|
|
|
|
|
|
-name => \$name, |
46
|
|
|
|
|
|
|
-value => \$value, |
47
|
|
|
|
|
|
|
-postfix => \$postfix, |
48
|
|
|
|
|
|
|
-separator => \$separator, |
49
|
|
|
|
|
|
|
); |
50
|
|
|
|
|
|
|
|
51
|
7
|
|
|
|
|
26
|
while (my ($arg, $val) = each %args) { |
52
|
23
|
|
|
|
|
39
|
my $vset = $set{lc($arg)}; |
53
|
23
|
50
|
|
|
|
41
|
next unless ref $vset; |
54
|
23
|
|
|
|
|
64
|
$$vset = $val; |
55
|
|
|
|
|
|
|
} |
56
|
|
|
|
|
|
|
|
57
|
7
|
|
|
|
|
29
|
$self->_init($name, $postfix, $separator); |
58
|
7
|
|
|
|
|
11
|
$self->{string} = $value; |
59
|
|
|
|
|
|
|
|
60
|
7
|
|
|
|
|
25
|
return $self; |
61
|
|
|
|
|
|
|
} |
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
# |
64
|
|
|
|
|
|
|
# Defined routines |
65
|
|
|
|
|
|
|
# |
66
|
|
|
|
|
|
|
|
67
|
8
|
|
|
8
|
1
|
23
|
sub string { $_[0]->{'string'} } |
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
1; # for "require" |
70
|
|
|
|
|
|
|
__END__ |