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
|
|
418
|
use strict;
|
|
2
|
|
|
|
|
4
|
|
|
2
|
|
|
|
|
91
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
########################################################################
|
17
|
|
|
|
|
|
|
package Log::Agent::Tag::String;
|
18
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
require Log::Agent::Tag;
|
20
|
2
|
|
|
2
|
|
11
|
use vars qw(@ISA);
|
|
2
|
|
|
|
|
3
|
|
|
2
|
|
|
|
|
460
|
|
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
|
6
|
|
|
6
|
0
|
27
|
my $self = bless {}, shift;
|
41
|
6
|
|
|
|
|
23
|
my (%args) = @_;
|
42
|
6
|
|
|
|
|
14
|
my ($name, $postfix, $separator, $value);
|
43
|
|
|
|
|
|
|
|
44
|
6
|
|
|
|
|
21
|
my %set = (
|
45
|
|
|
|
|
|
|
-name => \$name,
|
46
|
|
|
|
|
|
|
-value => \$value,
|
47
|
|
|
|
|
|
|
-postfix => \$postfix,
|
48
|
|
|
|
|
|
|
-separator => \$separator,
|
49
|
|
|
|
|
|
|
);
|
50
|
|
|
|
|
|
|
|
51
|
6
|
|
|
|
|
27
|
while (my ($arg, $val) = each %args) {
|
52
|
19
|
|
|
|
|
36
|
my $vset = $set{lc($arg)};
|
53
|
19
|
50
|
|
|
|
39
|
next unless ref $vset;
|
54
|
19
|
|
|
|
|
51
|
$$vset = $val;
|
55
|
|
|
|
|
|
|
}
|
56
|
|
|
|
|
|
|
|
57
|
6
|
|
|
|
|
31
|
$self->_init($name, $postfix, $separator);
|
58
|
6
|
|
|
|
|
10
|
$self->{string} = $value;
|
59
|
|
|
|
|
|
|
|
60
|
6
|
|
|
|
|
23
|
return $self;
|
61
|
|
|
|
|
|
|
}
|
62
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
#
|
64
|
|
|
|
|
|
|
# Defined routines
|
65
|
|
|
|
|
|
|
#
|
66
|
|
|
|
|
|
|
|
67
|
7
|
|
|
7
|
1
|
21
|
sub string { $_[0]->{'string'} }
|
68
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
1; # for "require"
|
70
|
|
|
|
|
|
|
__END__
|