vinted-log4r 1.1.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/doc/content/contact.html +22 -0
- data/doc/content/contribute.html +21 -0
- data/doc/content/index.html +90 -0
- data/doc/content/license.html +56 -0
- data/doc/content/manual.html +449 -0
- data/doc/dev/README.developers +55 -0
- data/doc/dev/checklist +23 -0
- data/doc/dev/things-to-do +5 -0
- data/doc/images/log4r-logo.png +0 -0
- data/doc/images/logo2.png +0 -0
- data/doc/log4r.css +111 -0
- data/doc/rdoc-log4r.css +696 -0
- data/doc/templates/main.html +147 -0
- data/examples/README +19 -0
- data/examples/ancestors.rb +53 -0
- data/examples/chainsaw_settings.xml +7 -0
- data/examples/customlevels.rb +34 -0
- data/examples/filelog.rb +25 -0
- data/examples/fileroll.rb +40 -0
- data/examples/gmail.rb +30 -0
- data/examples/gmail.yaml +95 -0
- data/examples/log4r_yaml.yaml +0 -0
- data/examples/logclient.rb +25 -0
- data/examples/logserver.rb +18 -0
- data/examples/moderate.xml +29 -0
- data/examples/moderateconfig.rb +66 -0
- data/examples/myformatter.rb +23 -0
- data/examples/outofthebox.rb +21 -0
- data/examples/rdoc-gen +2 -0
- data/examples/rrconfig.xml +63 -0
- data/examples/rrsetup.rb +42 -0
- data/examples/simpleconfig.rb +39 -0
- data/examples/syslogcustom.rb +52 -0
- data/examples/xmlconfig.rb +25 -0
- data/examples/yaml.rb +30 -0
- data/lib/log4r.rb +17 -0
- data/lib/log4r/GDC.rb +41 -0
- data/lib/log4r/MDC.rb +59 -0
- data/lib/log4r/NDC.rb +86 -0
- data/lib/log4r/base.rb +74 -0
- data/lib/log4r/config.rb +9 -0
- data/lib/log4r/configurator.rb +224 -0
- data/lib/log4r/formatter/formatter.rb +105 -0
- data/lib/log4r/formatter/log4jxmlformatter.rb +65 -0
- data/lib/log4r/formatter/patternformatter.rb +145 -0
- data/lib/log4r/lib/drbloader.rb +52 -0
- data/lib/log4r/lib/xmlloader.rb +24 -0
- data/lib/log4r/logevent.rb +28 -0
- data/lib/log4r/logger.rb +216 -0
- data/lib/log4r/loggerfactory.rb +89 -0
- data/lib/log4r/logserver.rb +28 -0
- data/lib/log4r/outputter/consoleoutputters.rb +18 -0
- data/lib/log4r/outputter/datefileoutputter.rb +117 -0
- data/lib/log4r/outputter/emailoutputter.rb +143 -0
- data/lib/log4r/outputter/fileoutputter.rb +57 -0
- data/lib/log4r/outputter/iooutputter.rb +55 -0
- data/lib/log4r/outputter/outputter.rb +134 -0
- data/lib/log4r/outputter/outputterfactory.rb +60 -0
- data/lib/log4r/outputter/remoteoutputter.rb +40 -0
- data/lib/log4r/outputter/rollingfileoutputter.rb +234 -0
- data/lib/log4r/outputter/scribeoutputter.rb +37 -0
- data/lib/log4r/outputter/staticoutputter.rb +30 -0
- data/lib/log4r/outputter/syslogoutputter.rb +126 -0
- data/lib/log4r/outputter/udpoutputter.rb +53 -0
- data/lib/log4r/rdoc/GDC +14 -0
- data/lib/log4r/rdoc/MDC +16 -0
- data/lib/log4r/rdoc/NDC +41 -0
- data/lib/log4r/rdoc/configurator +243 -0
- data/lib/log4r/rdoc/emailoutputter +103 -0
- data/lib/log4r/rdoc/formatter +39 -0
- data/lib/log4r/rdoc/log4jxmlformatter +21 -0
- data/lib/log4r/rdoc/log4r +89 -0
- data/lib/log4r/rdoc/logger +175 -0
- data/lib/log4r/rdoc/logserver +85 -0
- data/lib/log4r/rdoc/outputter +108 -0
- data/lib/log4r/rdoc/patternformatter +128 -0
- data/lib/log4r/rdoc/scribeoutputter +16 -0
- data/lib/log4r/rdoc/syslogoutputter +29 -0
- data/lib/log4r/rdoc/win32eventoutputter +7 -0
- data/lib/log4r/rdoc/yamlconfigurator +20 -0
- data/lib/log4r/repository.rb +88 -0
- data/lib/log4r/staticlogger.rb +49 -0
- data/lib/log4r/version.rb +4 -0
- data/lib/log4r/yamlconfigurator.rb +198 -0
- data/tests/README +10 -0
- data/tests/testGDC.rb +24 -0
- data/tests/testMDC.rb +40 -0
- data/tests/testNDC.rb +25 -0
- data/tests/test_helper.rb +12 -0
- data/tests/testall.rb +6 -0
- data/tests/testbase.rb +48 -0
- data/tests/testchainsaw.rb +42 -0
- data/tests/testconf.xml +37 -0
- data/tests/testcustom.rb +30 -0
- data/tests/testformatter.rb +31 -0
- data/tests/testlogger.rb +200 -0
- data/tests/testoutputter.rb +146 -0
- data/tests/testpatternformatter.rb +76 -0
- data/tests/testthreads.rb +31 -0
- data/tests/testxmlconf.rb +48 -0
- data/tests/testyaml.rb +39 -0
- data/tests/testyaml_arrays.yaml +25 -0
- data/tests/testyaml_injection.yaml +22 -0
- metadata +193 -0
@@ -0,0 +1,31 @@
|
|
1
|
+
# $Id$
|
2
|
+
# Test guts sent in by chetreddy bug #27184
|
3
|
+
#
|
4
|
+
# Note: this test won't always catch a threading problem, as it
|
5
|
+
# relies on a brute force approach. NUM_THREADS can be increased
|
6
|
+
# to stress the system longer and therefore increasing the chance
|
7
|
+
# of exposing a threading issue, however, it is not a definitive
|
8
|
+
# test.
|
9
|
+
#
|
10
|
+
|
11
|
+
require 'test_helper'
|
12
|
+
|
13
|
+
class TestThreads < TestCase
|
14
|
+
include Log4r
|
15
|
+
|
16
|
+
NUMTHREADS = 1000
|
17
|
+
|
18
|
+
def test_threads
|
19
|
+
|
20
|
+
assert_nothing_raised do
|
21
|
+
(0..NUMTHREADS).map do |i|
|
22
|
+
Thread.new do
|
23
|
+
Thread.current[:logger] = Log4r::Logger.new "Hello #{i}"
|
24
|
+
Thread.current[:logger].outputters = [StdoutOutputter.new("log4r#{i}")]
|
25
|
+
Thread.current[:logger].outputters.each { |j| j.flush }
|
26
|
+
Thread.current.exit()
|
27
|
+
end
|
28
|
+
end.each do |thr| thr.join end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
@@ -0,0 +1,48 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
One=<<-EOX
|
4
|
+
<log4r_config><pre_config><custom_levels> Foo </custom_levels>
|
5
|
+
</pre_config></log4r_config>
|
6
|
+
EOX
|
7
|
+
Two=<<-EOX
|
8
|
+
<log4r_config><pre_config><global level="DEBUG"/></pre_config></log4r_config>
|
9
|
+
EOX
|
10
|
+
Three=<<-EOX
|
11
|
+
<log4r_config><pre_config><custom_levels>Foo</custom_levels>
|
12
|
+
<global level="Foo"/></pre_config>
|
13
|
+
</log4r_config>
|
14
|
+
EOX
|
15
|
+
|
16
|
+
# must be run independently
|
17
|
+
class TestXmlConf < TestCase
|
18
|
+
include Log4r
|
19
|
+
|
20
|
+
def test_load1
|
21
|
+
Configurator.load_xml_string(One)
|
22
|
+
assert_nothing_raised{
|
23
|
+
assert(Foo == 1)
|
24
|
+
assert(Logger.global.level == ALL)
|
25
|
+
}
|
26
|
+
end
|
27
|
+
def test_load2
|
28
|
+
Configurator.load_xml_string(Two)
|
29
|
+
assert_nothing_raised{
|
30
|
+
assert(Logger.global.level == DEBUG)
|
31
|
+
}
|
32
|
+
end
|
33
|
+
def test_load3
|
34
|
+
Configurator.load_xml_string(Three)
|
35
|
+
assert_nothing_raised{
|
36
|
+
assert(Foo == 1)
|
37
|
+
assert(Logger.global.level == Foo)
|
38
|
+
}
|
39
|
+
end
|
40
|
+
def test_load4
|
41
|
+
assert_nothing_raised {
|
42
|
+
Configurator['logpath'] = '.'
|
43
|
+
Configurator.load_xml_file "testconf.xml"
|
44
|
+
a = Logger['first::second']
|
45
|
+
a.bing "what the heck"
|
46
|
+
}
|
47
|
+
end
|
48
|
+
end
|
data/tests/testyaml.rb
ADDED
@@ -0,0 +1,39 @@
|
|
1
|
+
require 'test_helper'
|
2
|
+
|
3
|
+
# Define a custom outputter that allows arrays in configuration hash
|
4
|
+
module Log4r
|
5
|
+
class TestYamlOutputter < Outputter
|
6
|
+
# expose array parameter
|
7
|
+
attr_reader :array_param
|
8
|
+
|
9
|
+
def initialize(name, hash = {})
|
10
|
+
@array_param = hash['array_param']
|
11
|
+
end
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
|
16
|
+
class TestYaml < TestCase
|
17
|
+
include Log4r
|
18
|
+
|
19
|
+
def setup
|
20
|
+
@cfg = YamlConfigurator # shorthand
|
21
|
+
@cfg['CUSTOM_DOMAIN'] = 'bar.com'
|
22
|
+
end
|
23
|
+
|
24
|
+
def test_injection
|
25
|
+
assert_nothing_raised("Exception injected") do
|
26
|
+
@cfg.load_yaml_file(File.join(File.dirname(__FILE__),'testyaml_injection.yaml'))
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
def test_arrays
|
31
|
+
assert_nothing_raised("Parser couldn't handle arrays in YAML") do
|
32
|
+
@cfg.load_yaml_file(File.join(File.dirname(__FILE__),'testyaml_arrays.yaml'))
|
33
|
+
end
|
34
|
+
log = Logger['mylogger']
|
35
|
+
assert_instance_of(Array, log.outputters.first.array_param, 'Array not loaded properly from YAML')
|
36
|
+
assert_equal('wilma@bar.com', log.outputters.first.array_param[2], '#{}-style parameter interpolation doesn\'t work properly in arrays')
|
37
|
+
end
|
38
|
+
end
|
39
|
+
|
@@ -0,0 +1,25 @@
|
|
1
|
+
log4r_config:
|
2
|
+
|
3
|
+
# define all loggers ...
|
4
|
+
loggers:
|
5
|
+
- name : mylogger
|
6
|
+
level : INFO
|
7
|
+
additive : 'false'
|
8
|
+
trace : 'false'
|
9
|
+
outputters:
|
10
|
+
- testyaml
|
11
|
+
|
12
|
+
# define all outputters (incl. formatters)
|
13
|
+
outputters:
|
14
|
+
- type : TestYamlOutputter
|
15
|
+
name : testyaml
|
16
|
+
level : INFO
|
17
|
+
array_param:
|
18
|
+
- fred@foo.com
|
19
|
+
- barney@foo.com
|
20
|
+
- 'wilma@#{CUSTOM_DOMAIN}'
|
21
|
+
formatter:
|
22
|
+
date_pattern: '%y%m%d %H:%M:%S'
|
23
|
+
pattern : '%d %l: %m '
|
24
|
+
type : PatternFormatter
|
25
|
+
|
@@ -0,0 +1,22 @@
|
|
1
|
+
log4r_config:
|
2
|
+
|
3
|
+
# define all loggers ...
|
4
|
+
loggers:
|
5
|
+
- name : mylogger
|
6
|
+
level : INFO
|
7
|
+
additive : 'false'
|
8
|
+
trace : 'false'
|
9
|
+
outputters:
|
10
|
+
- stderr
|
11
|
+
|
12
|
+
# define all outputters (incl. formatters)
|
13
|
+
outputters:
|
14
|
+
- type : StderrOutputter
|
15
|
+
name : stderr
|
16
|
+
level : INFO
|
17
|
+
crash : "'; raise Exception #"
|
18
|
+
formatter:
|
19
|
+
date_pattern: '%y%m%d %H:%M:%S'
|
20
|
+
pattern : '%d %l: %m '
|
21
|
+
type : PatternFormatter
|
22
|
+
|
metadata
ADDED
@@ -0,0 +1,193 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: vinted-log4r
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 1.1.11
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Justas Janauskas
|
8
|
+
- tony kerz
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2013-11-10 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: bundler
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- - '>='
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: 1.0.0
|
21
|
+
type: :development
|
22
|
+
prerelease: false
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - '>='
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: 1.0.0
|
28
|
+
- !ruby/object:Gem::Dependency
|
29
|
+
name: rake
|
30
|
+
requirement: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - ~>
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: 0.8.7
|
35
|
+
type: :development
|
36
|
+
prerelease: false
|
37
|
+
version_requirements: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - ~>
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: 0.8.7
|
42
|
+
description: 'See also: http://logging.apache.org/log4j'
|
43
|
+
email: jjanauskas@gmail.com
|
44
|
+
executables: []
|
45
|
+
extensions: []
|
46
|
+
extra_rdoc_files: []
|
47
|
+
files:
|
48
|
+
- doc/content/contact.html
|
49
|
+
- doc/content/contribute.html
|
50
|
+
- doc/content/index.html
|
51
|
+
- doc/content/license.html
|
52
|
+
- doc/content/manual.html
|
53
|
+
- doc/dev/checklist
|
54
|
+
- doc/dev/README.developers
|
55
|
+
- doc/dev/things-to-do
|
56
|
+
- doc/images/log4r-logo.png
|
57
|
+
- doc/images/logo2.png
|
58
|
+
- doc/log4r.css
|
59
|
+
- doc/rdoc-log4r.css
|
60
|
+
- doc/templates/main.html
|
61
|
+
- examples/ancestors.rb
|
62
|
+
- examples/chainsaw_settings.xml
|
63
|
+
- examples/customlevels.rb
|
64
|
+
- examples/filelog.rb
|
65
|
+
- examples/fileroll.rb
|
66
|
+
- examples/gmail.rb
|
67
|
+
- examples/gmail.yaml
|
68
|
+
- examples/log4r_yaml.yaml
|
69
|
+
- examples/logclient.rb
|
70
|
+
- examples/logserver.rb
|
71
|
+
- examples/moderate.xml
|
72
|
+
- examples/moderateconfig.rb
|
73
|
+
- examples/myformatter.rb
|
74
|
+
- examples/outofthebox.rb
|
75
|
+
- examples/rdoc-gen
|
76
|
+
- examples/README
|
77
|
+
- examples/rrconfig.xml
|
78
|
+
- examples/rrsetup.rb
|
79
|
+
- examples/simpleconfig.rb
|
80
|
+
- examples/syslogcustom.rb
|
81
|
+
- examples/xmlconfig.rb
|
82
|
+
- examples/yaml.rb
|
83
|
+
- lib/log4r/base.rb
|
84
|
+
- lib/log4r/config.rb
|
85
|
+
- lib/log4r/configurator.rb
|
86
|
+
- lib/log4r/formatter/formatter.rb
|
87
|
+
- lib/log4r/formatter/log4jxmlformatter.rb
|
88
|
+
- lib/log4r/formatter/patternformatter.rb
|
89
|
+
- lib/log4r/GDC.rb
|
90
|
+
- lib/log4r/lib/drbloader.rb
|
91
|
+
- lib/log4r/lib/xmlloader.rb
|
92
|
+
- lib/log4r/logevent.rb
|
93
|
+
- lib/log4r/logger.rb
|
94
|
+
- lib/log4r/loggerfactory.rb
|
95
|
+
- lib/log4r/logserver.rb
|
96
|
+
- lib/log4r/MDC.rb
|
97
|
+
- lib/log4r/NDC.rb
|
98
|
+
- lib/log4r/outputter/consoleoutputters.rb
|
99
|
+
- lib/log4r/outputter/datefileoutputter.rb
|
100
|
+
- lib/log4r/outputter/emailoutputter.rb
|
101
|
+
- lib/log4r/outputter/fileoutputter.rb
|
102
|
+
- lib/log4r/outputter/iooutputter.rb
|
103
|
+
- lib/log4r/outputter/outputter.rb
|
104
|
+
- lib/log4r/outputter/outputterfactory.rb
|
105
|
+
- lib/log4r/outputter/remoteoutputter.rb
|
106
|
+
- lib/log4r/outputter/rollingfileoutputter.rb
|
107
|
+
- lib/log4r/outputter/scribeoutputter.rb
|
108
|
+
- lib/log4r/outputter/staticoutputter.rb
|
109
|
+
- lib/log4r/outputter/syslogoutputter.rb
|
110
|
+
- lib/log4r/outputter/udpoutputter.rb
|
111
|
+
- lib/log4r/rdoc/configurator
|
112
|
+
- lib/log4r/rdoc/emailoutputter
|
113
|
+
- lib/log4r/rdoc/formatter
|
114
|
+
- lib/log4r/rdoc/GDC
|
115
|
+
- lib/log4r/rdoc/log4jxmlformatter
|
116
|
+
- lib/log4r/rdoc/log4r
|
117
|
+
- lib/log4r/rdoc/logger
|
118
|
+
- lib/log4r/rdoc/logserver
|
119
|
+
- lib/log4r/rdoc/MDC
|
120
|
+
- lib/log4r/rdoc/NDC
|
121
|
+
- lib/log4r/rdoc/outputter
|
122
|
+
- lib/log4r/rdoc/patternformatter
|
123
|
+
- lib/log4r/rdoc/scribeoutputter
|
124
|
+
- lib/log4r/rdoc/syslogoutputter
|
125
|
+
- lib/log4r/rdoc/win32eventoutputter
|
126
|
+
- lib/log4r/rdoc/yamlconfigurator
|
127
|
+
- lib/log4r/repository.rb
|
128
|
+
- lib/log4r/staticlogger.rb
|
129
|
+
- lib/log4r/version.rb
|
130
|
+
- lib/log4r/yamlconfigurator.rb
|
131
|
+
- lib/log4r.rb
|
132
|
+
- tests/README
|
133
|
+
- tests/test_helper.rb
|
134
|
+
- tests/testall.rb
|
135
|
+
- tests/testbase.rb
|
136
|
+
- tests/testchainsaw.rb
|
137
|
+
- tests/testconf.xml
|
138
|
+
- tests/testcustom.rb
|
139
|
+
- tests/testformatter.rb
|
140
|
+
- tests/testGDC.rb
|
141
|
+
- tests/testlogger.rb
|
142
|
+
- tests/testMDC.rb
|
143
|
+
- tests/testNDC.rb
|
144
|
+
- tests/testoutputter.rb
|
145
|
+
- tests/testpatternformatter.rb
|
146
|
+
- tests/testthreads.rb
|
147
|
+
- tests/testxmlconf.rb
|
148
|
+
- tests/testyaml.rb
|
149
|
+
- tests/testyaml_arrays.yaml
|
150
|
+
- tests/testyaml_injection.yaml
|
151
|
+
homepage: http://log4r.rubyforge.org
|
152
|
+
licenses: []
|
153
|
+
metadata: {}
|
154
|
+
post_install_message:
|
155
|
+
rdoc_options: []
|
156
|
+
require_paths:
|
157
|
+
- lib
|
158
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
159
|
+
requirements:
|
160
|
+
- - '>='
|
161
|
+
- !ruby/object:Gem::Version
|
162
|
+
version: '0'
|
163
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
164
|
+
requirements:
|
165
|
+
- - '>='
|
166
|
+
- !ruby/object:Gem::Version
|
167
|
+
version: '0'
|
168
|
+
requirements: []
|
169
|
+
rubyforge_project:
|
170
|
+
rubygems_version: 2.0.3
|
171
|
+
signing_key:
|
172
|
+
specification_version: 4
|
173
|
+
summary: Log4r, logging framework for ruby
|
174
|
+
test_files:
|
175
|
+
- tests/README
|
176
|
+
- tests/test_helper.rb
|
177
|
+
- tests/testall.rb
|
178
|
+
- tests/testbase.rb
|
179
|
+
- tests/testchainsaw.rb
|
180
|
+
- tests/testconf.xml
|
181
|
+
- tests/testcustom.rb
|
182
|
+
- tests/testformatter.rb
|
183
|
+
- tests/testGDC.rb
|
184
|
+
- tests/testlogger.rb
|
185
|
+
- tests/testMDC.rb
|
186
|
+
- tests/testNDC.rb
|
187
|
+
- tests/testoutputter.rb
|
188
|
+
- tests/testpatternformatter.rb
|
189
|
+
- tests/testthreads.rb
|
190
|
+
- tests/testxmlconf.rb
|
191
|
+
- tests/testyaml.rb
|
192
|
+
- tests/testyaml_arrays.yaml
|
193
|
+
- tests/testyaml_injection.yaml
|