lines 0.1.22 → 0.1.23
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/lines.rb +7 -4
- data/lib/lines/active_record.rb +1 -1
- data/lib/lines/rack_logger.rb +3 -3
- data/lib/lines/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NTIwMmJjMDE2ODE1NTNjMmFlMDEyNTlmOTVkZDIyYzliOTI5NzMyYg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
ODM3YmQzNjcwOGNjNTQ3NTViNTNlZTRiZmMyMjc1ZWJkYjZmOGE2OQ==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
ZGM2NDAwM2YwMmZhZWM4MTk4MzA0MDY1YTZmZDc0MGE5OTQyYjU1MTI3MTM1
|
10
|
+
NDU0N2JiZWM3ZGZkOGNhNjQzYzc2MTUwMzA0M2RkZmFjZDEyMWQ3YWM1MDNm
|
11
|
+
MTc5NGIyYTQwNWQ5MjIxNmU1MjhjZWVhMzc5MzE0OWFiNzMwZTA=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YjM5OWRkYjFlMmM4MWI4YWI2YzVmMDlmY2Y5OTVkMDgzOGUxYTM0ZjNlYzUx
|
14
|
+
OGEzOTM3ZjEwYWI1MGU0OTViYjE1ZGRjMDdiMzQzOWFhYzA4MmFmYzNkNDA2
|
15
|
+
Nzg3ZTU0NzcxM2Q3ODdmOGI0M2ViMWRlOTIzMTI5YWQwNDk4MDk=
|
data/lib/lines.rb
CHANGED
@@ -75,7 +75,7 @@ module Lines
|
|
75
75
|
# Returns a backward-compatibile logger
|
76
76
|
def logger
|
77
77
|
@logger ||= (
|
78
|
-
require
|
78
|
+
require 'lines/logger'
|
79
79
|
Logger.new(self)
|
80
80
|
)
|
81
81
|
end
|
@@ -176,6 +176,9 @@ module Lines
|
|
176
176
|
level = extract_pri(obj)
|
177
177
|
str = dumper.dump(obj)
|
178
178
|
|
179
|
+
# Escape printf formatting
|
180
|
+
str.gsub!('%', '%%')
|
181
|
+
|
179
182
|
syslog.log(level, str)
|
180
183
|
end
|
181
184
|
|
@@ -276,9 +279,9 @@ module Lines
|
|
276
279
|
when String, Symbol then strenc(x)
|
277
280
|
when Numeric then numenc(x)
|
278
281
|
when Time, Date then timeenc(x)
|
279
|
-
when true then
|
280
|
-
when false then
|
281
|
-
when nil then
|
282
|
+
when true then '#t'
|
283
|
+
when false then '#f'
|
284
|
+
when nil then 'nil'
|
282
285
|
else
|
283
286
|
litenc(x)
|
284
287
|
end
|
data/lib/lines/active_record.rb
CHANGED
data/lib/lines/rack_logger.rb
CHANGED
@@ -5,7 +5,7 @@ module Lines
|
|
5
5
|
class RackLogger < Rack::CommonLogger
|
6
6
|
# In development mode the common logger is always inserted
|
7
7
|
def self.silence_common_logger!
|
8
|
-
Rack::CommonLogger.module_eval(
|
8
|
+
Rack::CommonLogger.module_eval('def call(env); @app.call(env); end')
|
9
9
|
self
|
10
10
|
end
|
11
11
|
|
@@ -25,11 +25,11 @@ module Lines
|
|
25
25
|
|
26
26
|
def log(env, status, header, began_at)
|
27
27
|
Lines.log(
|
28
|
-
remote_addr: env['HTTP_X_FORWARDED_FOR'] || env[
|
28
|
+
remote_addr: env['HTTP_X_FORWARDED_FOR'] || env['REMOTE_ADDR'],
|
29
29
|
remote_user: env['REMOTE_USER'] || '',
|
30
30
|
method: env['REQUEST_METHOD'],
|
31
31
|
path: env['PATH_INFO'],
|
32
|
-
query: env[
|
32
|
+
query: env['QUERY_STRING'],
|
33
33
|
status: status.to_s[0..3],
|
34
34
|
length: extract_content_length(header),
|
35
35
|
elapsed: [Time.now - began_at, 's'],
|
data/lib/lines/version.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.23
|
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-
|
11
|
+
date: 2013-07-08 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|