| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
########################################################################### |
|
2
|
|
|
|
|
|
|
# |
|
3
|
|
|
|
|
|
|
# String.pm |
|
4
|
|
|
|
|
|
|
# |
|
5
|
|
|
|
|
|
|
# Copyright (C) 1999 Raphael Manfredi. |
|
6
|
|
|
|
|
|
|
# Copyright (C) 2002-2015 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
|
|
540
|
use strict; |
|
|
2
|
|
|
|
|
4
|
|
|
|
2
|
|
|
|
|
81
|
|
|
15
|
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
######################################################################## |
|
17
|
|
|
|
|
|
|
package Log::Agent::Tag::String; |
|
18
|
|
|
|
|
|
|
|
|
19
|
|
|
|
|
|
|
require Log::Agent::Tag; |
|
20
|
2
|
|
|
2
|
|
10
|
use vars qw(@ISA); |
|
|
2
|
|
|
|
|
4
|
|
|
|
2
|
|
|
|
|
411
|
|
|
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
|
24
|
my $self = bless {}, shift; |
|
41
|
6
|
|
|
|
|
23
|
my (%args) = @_; |
|
42
|
6
|
|
|
|
|
9
|
my ($name, $postfix, $separator, $value); |
|
43
|
|
|
|
|
|
|
|
|
44
|
6
|
|
|
|
|
25
|
my %set = ( |
|
45
|
|
|
|
|
|
|
-name => \$name, |
|
46
|
|
|
|
|
|
|
-value => \$value, |
|
47
|
|
|
|
|
|
|
-postfix => \$postfix, |
|
48
|
|
|
|
|
|
|
-separator => \$separator, |
|
49
|
|
|
|
|
|
|
); |
|
50
|
|
|
|
|
|
|
|
|
51
|
6
|
|
|
|
|
22
|
while (my ($arg, $val) = each %args) { |
|
52
|
19
|
|
|
|
|
36
|
my $vset = $set{lc($arg)}; |
|
53
|
19
|
50
|
|
|
|
47
|
next unless ref $vset; |
|
54
|
19
|
|
|
|
|
66
|
$$vset = $val; |
|
55
|
|
|
|
|
|
|
} |
|
56
|
|
|
|
|
|
|
|
|
57
|
6
|
|
|
|
|
24
|
$self->_init($name, $postfix, $separator); |
|
58
|
6
|
|
|
|
|
10
|
$self->{string} = $value; |
|
59
|
|
|
|
|
|
|
|
|
60
|
6
|
|
|
|
|
25
|
return $self; |
|
61
|
|
|
|
|
|
|
} |
|
62
|
|
|
|
|
|
|
|
|
63
|
|
|
|
|
|
|
# |
|
64
|
|
|
|
|
|
|
# Defined routines |
|
65
|
|
|
|
|
|
|
# |
|
66
|
|
|
|
|
|
|
|
|
67
|
7
|
|
|
7
|
1
|
24
|
sub string { $_[0]->{'string'} } |
|
68
|
|
|
|
|
|
|
|
|
69
|
|
|
|
|
|
|
1; # for "require" |
|
70
|
|
|
|
|
|
|
__END__ |