lumber 0.13.2 → 0.13.4
Sign up to get free protection for your applications and to get access to all the features.
- data/CHANGELOG +9 -0
- data/README.md +2 -0
- data/lib/lumber/level_util.rb +11 -3
- data/lib/lumber/version.rb +1 -1
- data/spec/lumber_spec.rb +2 -2
- metadata +46 -51
data/CHANGELOG
CHANGED
data/README.md
CHANGED
data/lib/lumber/level_util.rb
CHANGED
@@ -2,8 +2,10 @@ module Lumber
|
|
2
2
|
module LevelUtil
|
3
3
|
|
4
4
|
# So we have a named thread and can tell which we are in Thread.list
|
5
|
-
class MonitorThread < Thread
|
6
|
-
|
5
|
+
class MonitorThread < Thread
|
6
|
+
attr_accessor :should_exit
|
7
|
+
end
|
8
|
+
|
7
9
|
extend MonitorMixin
|
8
10
|
|
9
11
|
LOG_LEVELS_KEY = "lumber:log_levels"
|
@@ -78,8 +80,10 @@ module Lumber
|
|
78
80
|
# @return [Thread] The monitor thread
|
79
81
|
#
|
80
82
|
def start_monitor(interval=10)
|
81
|
-
MonitorThread.new do
|
83
|
+
t = MonitorThread.new do
|
82
84
|
loop do
|
85
|
+
break if Thread.current.should_exit
|
86
|
+
|
83
87
|
begin
|
84
88
|
activate_levels
|
85
89
|
rescue => e
|
@@ -88,6 +92,10 @@ module Lumber
|
|
88
92
|
sleep interval
|
89
93
|
end
|
90
94
|
end
|
95
|
+
|
96
|
+
at_exit { t.should_exit = true }
|
97
|
+
|
98
|
+
t
|
91
99
|
end
|
92
100
|
|
93
101
|
protected
|
data/lib/lumber/version.rb
CHANGED
data/spec/lumber_spec.rb
CHANGED
@@ -165,9 +165,9 @@ describe Lumber do
|
|
165
165
|
end
|
166
166
|
|
167
167
|
it "has context vars" do
|
168
|
-
Log4r::MDC.put("foo", "bar")
|
169
168
|
Log4r::MDC.put("baz", "boo")
|
170
|
-
|
169
|
+
Log4r::MDC.put("foo", "bar")
|
170
|
+
Lumber.format_mdc.should == "baz=boo foo=bar"
|
171
171
|
end
|
172
172
|
|
173
173
|
it "escapes %" do
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lumber
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.13.
|
4
|
+
version: 0.13.4
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,168 +9,168 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2013-01-03 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
|
+
type: :runtime
|
15
16
|
name: log4r
|
17
|
+
prerelease: false
|
16
18
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
19
|
requirements:
|
19
20
|
- - ~>
|
20
21
|
- !ruby/object:Gem::Version
|
21
22
|
version: 1.1.10
|
22
|
-
type: :runtime
|
23
|
-
prerelease: false
|
24
|
-
version_requirements: !ruby/object:Gem::Requirement
|
25
23
|
none: false
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
26
25
|
requirements:
|
27
26
|
- - ~>
|
28
27
|
- !ruby/object:Gem::Version
|
29
28
|
version: 1.1.10
|
29
|
+
none: false
|
30
30
|
- !ruby/object:Gem::Dependency
|
31
|
+
type: :runtime
|
31
32
|
name: activesupport
|
33
|
+
prerelease: false
|
32
34
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
35
|
requirements:
|
35
36
|
- - ! '>='
|
36
37
|
- !ruby/object:Gem::Version
|
37
38
|
version: '0'
|
38
|
-
type: :runtime
|
39
|
-
prerelease: false
|
40
|
-
version_requirements: !ruby/object:Gem::Requirement
|
41
39
|
none: false
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
42
41
|
requirements:
|
43
42
|
- - ! '>='
|
44
43
|
- !ruby/object:Gem::Version
|
45
44
|
version: '0'
|
45
|
+
none: false
|
46
46
|
- !ruby/object:Gem::Dependency
|
47
|
+
type: :runtime
|
47
48
|
name: sinatra
|
49
|
+
prerelease: false
|
48
50
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
51
|
requirements:
|
51
52
|
- - ! '>='
|
52
53
|
- !ruby/object:Gem::Version
|
53
54
|
version: '0'
|
54
|
-
type: :runtime
|
55
|
-
prerelease: false
|
56
|
-
version_requirements: !ruby/object:Gem::Requirement
|
57
55
|
none: false
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
58
57
|
requirements:
|
59
58
|
- - ! '>='
|
60
59
|
- !ruby/object:Gem::Version
|
61
60
|
version: '0'
|
61
|
+
none: false
|
62
62
|
- !ruby/object:Gem::Dependency
|
63
|
+
type: :development
|
63
64
|
name: rake
|
65
|
+
prerelease: false
|
64
66
|
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
67
|
requirements:
|
67
68
|
- - ! '>='
|
68
69
|
- !ruby/object:Gem::Version
|
69
70
|
version: '0'
|
70
|
-
type: :development
|
71
|
-
prerelease: false
|
72
|
-
version_requirements: !ruby/object:Gem::Requirement
|
73
71
|
none: false
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
74
73
|
requirements:
|
75
74
|
- - ! '>='
|
76
75
|
- !ruby/object:Gem::Version
|
77
76
|
version: '0'
|
77
|
+
none: false
|
78
78
|
- !ruby/object:Gem::Dependency
|
79
|
+
type: :development
|
79
80
|
name: rspec
|
81
|
+
prerelease: false
|
80
82
|
requirement: !ruby/object:Gem::Requirement
|
81
|
-
none: false
|
82
83
|
requirements:
|
83
84
|
- - ! '>='
|
84
85
|
- !ruby/object:Gem::Version
|
85
86
|
version: '0'
|
86
|
-
type: :development
|
87
|
-
prerelease: false
|
88
|
-
version_requirements: !ruby/object:Gem::Requirement
|
89
87
|
none: false
|
88
|
+
version_requirements: !ruby/object:Gem::Requirement
|
90
89
|
requirements:
|
91
90
|
- - ! '>='
|
92
91
|
- !ruby/object:Gem::Version
|
93
92
|
version: '0'
|
93
|
+
none: false
|
94
94
|
- !ruby/object:Gem::Dependency
|
95
|
+
type: :development
|
95
96
|
name: rack-test
|
97
|
+
prerelease: false
|
96
98
|
requirement: !ruby/object:Gem::Requirement
|
97
|
-
none: false
|
98
99
|
requirements:
|
99
100
|
- - ! '>='
|
100
101
|
- !ruby/object:Gem::Version
|
101
102
|
version: '0'
|
102
|
-
type: :development
|
103
|
-
prerelease: false
|
104
|
-
version_requirements: !ruby/object:Gem::Requirement
|
105
103
|
none: false
|
104
|
+
version_requirements: !ruby/object:Gem::Requirement
|
106
105
|
requirements:
|
107
106
|
- - ! '>='
|
108
107
|
- !ruby/object:Gem::Version
|
109
108
|
version: '0'
|
109
|
+
none: false
|
110
110
|
- !ruby/object:Gem::Dependency
|
111
|
+
type: :development
|
111
112
|
name: capybara
|
113
|
+
prerelease: false
|
112
114
|
requirement: !ruby/object:Gem::Requirement
|
113
|
-
none: false
|
114
115
|
requirements:
|
115
116
|
- - ! '>='
|
116
117
|
- !ruby/object:Gem::Version
|
117
118
|
version: '0'
|
118
|
-
type: :development
|
119
|
-
prerelease: false
|
120
|
-
version_requirements: !ruby/object:Gem::Requirement
|
121
119
|
none: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
122
121
|
requirements:
|
123
122
|
- - ! '>='
|
124
123
|
- !ruby/object:Gem::Version
|
125
124
|
version: '0'
|
125
|
+
none: false
|
126
126
|
- !ruby/object:Gem::Dependency
|
127
|
+
type: :development
|
127
128
|
name: capybara-webkit
|
129
|
+
prerelease: false
|
128
130
|
requirement: !ruby/object:Gem::Requirement
|
129
|
-
none: false
|
130
131
|
requirements:
|
131
132
|
- - ! '>='
|
132
133
|
- !ruby/object:Gem::Version
|
133
134
|
version: '0'
|
134
|
-
type: :development
|
135
|
-
prerelease: false
|
136
|
-
version_requirements: !ruby/object:Gem::Requirement
|
137
135
|
none: false
|
136
|
+
version_requirements: !ruby/object:Gem::Requirement
|
138
137
|
requirements:
|
139
138
|
- - ! '>='
|
140
139
|
- !ruby/object:Gem::Version
|
141
140
|
version: '0'
|
141
|
+
none: false
|
142
142
|
- !ruby/object:Gem::Dependency
|
143
|
+
type: :development
|
143
144
|
name: awesome_print
|
145
|
+
prerelease: false
|
144
146
|
requirement: !ruby/object:Gem::Requirement
|
145
|
-
none: false
|
146
147
|
requirements:
|
147
148
|
- - ! '>='
|
148
149
|
- !ruby/object:Gem::Version
|
149
150
|
version: '0'
|
150
|
-
type: :development
|
151
|
-
prerelease: false
|
152
|
-
version_requirements: !ruby/object:Gem::Requirement
|
153
151
|
none: false
|
152
|
+
version_requirements: !ruby/object:Gem::Requirement
|
154
153
|
requirements:
|
155
154
|
- - ! '>='
|
156
155
|
- !ruby/object:Gem::Version
|
157
156
|
version: '0'
|
157
|
+
none: false
|
158
158
|
- !ruby/object:Gem::Dependency
|
159
|
+
type: :development
|
159
160
|
name: sinatra-contrib
|
161
|
+
prerelease: false
|
160
162
|
requirement: !ruby/object:Gem::Requirement
|
161
|
-
none: false
|
162
163
|
requirements:
|
163
164
|
- - ! '>='
|
164
165
|
- !ruby/object:Gem::Version
|
165
166
|
version: '0'
|
166
|
-
type: :development
|
167
|
-
prerelease: false
|
168
|
-
version_requirements: !ruby/object:Gem::Requirement
|
169
167
|
none: false
|
168
|
+
version_requirements: !ruby/object:Gem::Requirement
|
170
169
|
requirements:
|
171
170
|
- - ! '>='
|
172
171
|
- !ruby/object:Gem::Version
|
173
172
|
version: '0'
|
173
|
+
none: false
|
174
174
|
description: Lumber tries to make it easy to use the more robust log4r logging system
|
175
175
|
within your rails application. To do this it sets up log4r configuration from a
|
176
176
|
yml file, and provides utility methods for adding a :logger accessor to classes
|
@@ -228,26 +228,20 @@ rdoc_options: []
|
|
228
228
|
require_paths:
|
229
229
|
- lib
|
230
230
|
required_ruby_version: !ruby/object:Gem::Requirement
|
231
|
-
none: false
|
232
231
|
requirements:
|
233
232
|
- - ! '>='
|
234
233
|
- !ruby/object:Gem::Version
|
235
234
|
version: '0'
|
236
|
-
segments:
|
237
|
-
- 0
|
238
|
-
hash: -3620238288371511891
|
239
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
240
235
|
none: false
|
236
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
241
237
|
requirements:
|
242
238
|
- - ! '>='
|
243
239
|
- !ruby/object:Gem::Version
|
244
240
|
version: '0'
|
245
|
-
|
246
|
-
- 0
|
247
|
-
hash: -3620238288371511891
|
241
|
+
none: false
|
248
242
|
requirements: []
|
249
243
|
rubyforge_project:
|
250
|
-
rubygems_version: 1.8.
|
244
|
+
rubygems_version: 1.8.23
|
251
245
|
signing_key:
|
252
246
|
specification_version: 3
|
253
247
|
summary: Lumber integrates the log4r logging system within your application.
|
@@ -258,3 +252,4 @@ test_files:
|
|
258
252
|
- spec/server_spec.rb
|
259
253
|
- spec/spec.opts
|
260
254
|
- spec/spec_helper.rb
|
255
|
+
has_rdoc:
|