lines 0.1.24 → 0.1.25
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/CHANGELOG.md +10 -3
- data/lib/lines.rb +18 -20
- data/lib/lines/version.rb +1 -1
- data/spec/bench.rb +1 -0
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
YTI4MDczNmE2NTQ0NzYxNjk4MWI0ZDI1OTNjNzYxMDJmMDc2YTNhYg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NDc0YmRiNWU2ZDczNDIzZTg4NDlmZjE3NjVkZmU0ZGQ0MzA5MjJjOA==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
NzhmMjY0NGVjOWYyZWEzNzM4NjMyMzYxZDVlOTExNTVlZjkyYjBmNGZkNjky
|
10
|
+
OWYzZmVmOWJjNTcxNGI3NDg3NWJkYTk5MDk1ZTEyNjlkMWRjMGYzODA4MWI5
|
11
|
+
Y2UwM2NmOGY1Mzk4Y2UwNzBiNWNlMWFlNDAwY2QwNmM3OGM3Mzg=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
NzdiM2Y1NjJmZGMwY2YzNzNmNTkxMWYwZTNkNWU0NDVmNzJmY2Y4ODViNjNj
|
14
|
+
MWUwZjU2NGY0ZmY3MjY4OGU1M2ViNGMwODk3NzQ0YmRkZWFjMjk3MWUyYTk1
|
15
|
+
N2ZjYTJhMDIwZGQ3ZmNkZDU1OWNhMzNkYzM0OWQ0Zjk5NjY0OWY=
|
data/CHANGELOG.md
CHANGED
@@ -1,17 +1,24 @@
|
|
1
1
|
|
2
|
+
0.1.25 / 2013-07-10 : the "hopefully all syslog issues are fixes" edition
|
3
|
+
===================
|
4
|
+
|
5
|
+
* Change the logic of opening syslog with the app_name.
|
6
|
+
* Fixes syslog level extraction
|
7
|
+
* Fixes incorrect flag masks when opening syslog
|
8
|
+
|
2
9
|
0.1.24 / 2013-07-09
|
3
|
-
|
10
|
+
===================
|
4
11
|
|
5
12
|
* Fixes escaping issue with Syslog
|
6
13
|
|
7
14
|
0.1.22 / 2013-06-27
|
8
|
-
|
15
|
+
===================
|
9
16
|
|
10
17
|
* Fixes issue where Syslog is not recognized as an outputter
|
11
18
|
* Fixes issue when Lines.use is given an array of outputters
|
12
19
|
|
13
20
|
0.1.21 / 2013-06-27
|
14
|
-
|
21
|
+
===================
|
15
22
|
|
16
23
|
* Return self when silencing the Rack::CommonLogger
|
17
24
|
* Use Lines as the default ActiveRecord::Base logger
|
data/lib/lines.rb
CHANGED
@@ -152,22 +152,23 @@ module Lines
|
|
152
152
|
require 'syslog'
|
153
153
|
class SyslogOutputter
|
154
154
|
PRI2SYSLOG = {
|
155
|
-
debug
|
156
|
-
info
|
157
|
-
warn
|
158
|
-
warning
|
159
|
-
err
|
160
|
-
error
|
161
|
-
crit
|
162
|
-
critical
|
155
|
+
'debug' => Syslog::LOG_DEBUG,
|
156
|
+
'info' => Syslog::LOG_INFO,
|
157
|
+
'warn' => Syslog::LOG_WARNING,
|
158
|
+
'warning' => Syslog::LOG_WARNING,
|
159
|
+
'err' => Syslog::LOG_ERR,
|
160
|
+
'error' => Syslog::LOG_ERR,
|
161
|
+
'crit' => Syslog::LOG_CRIT,
|
162
|
+
'critical' => Syslog::LOG_CRIT,
|
163
163
|
}
|
164
164
|
|
165
|
-
def initialize(syslog = Syslog
|
165
|
+
def initialize(syslog = Syslog)
|
166
166
|
@syslog = syslog
|
167
|
-
prepare_syslog(app_name)
|
168
167
|
end
|
169
168
|
|
170
169
|
def output(dumper, obj)
|
170
|
+
prepare_syslog obj[:app]
|
171
|
+
|
171
172
|
obj = obj.dup
|
172
173
|
obj.delete(:pid) # It's going to be part of the message
|
173
174
|
obj.delete(:at) # Also part of the message
|
@@ -176,25 +177,22 @@ module Lines
|
|
176
177
|
level = extract_pri(obj)
|
177
178
|
str = dumper.dump(obj)
|
178
179
|
|
179
|
-
syslog.log(level, "%s", str)
|
180
|
+
@syslog.log(level, "%s", str)
|
180
181
|
end
|
181
182
|
|
182
183
|
protected
|
183
184
|
|
184
|
-
attr_reader :syslog
|
185
|
-
|
186
185
|
def prepare_syslog(app_name)
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
end
|
186
|
+
return if @syslog.opened?
|
187
|
+
app_name ||= File.basename($0)
|
188
|
+
@syslog.open(app_name,
|
189
|
+
Syslog::LOG_PID | Syslog::LOG_CONS | Syslog::LOG_NDELAY,
|
190
|
+
Syslog::LOG_USER)
|
193
191
|
end
|
194
192
|
|
195
193
|
def extract_pri(h)
|
196
194
|
pri = h.delete(:pri).to_s.downcase
|
197
|
-
PRI2SYSLOG[pri] ||
|
195
|
+
PRI2SYSLOG[pri] || Syslog::LOG_INFO
|
198
196
|
end
|
199
197
|
end
|
200
198
|
|
data/lib/lines/version.rb
CHANGED
data/spec/bench.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: lines
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.25
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jonas Pfenniger
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-07-
|
11
|
+
date: 2013-07-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|