logster 1.2.4 → 1.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +2 -4
- data/README.md +3 -0
- data/lib/logster/logger.rb +7 -5
- data/lib/logster/version.rb +1 -1
- data/test/logster/test_logger.rb +11 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e5bd9c8aad7d5ec1d82f59f986e31acaab5d3971
|
4
|
+
data.tar.gz: de9cc3c3e8fed4c525ded829cabdce79551a00e4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 40415629c1342f13e3f6b58defdcb09dc2adc0068ab744cdd904d55c373bfa705fac51a1c4c0b94f483483b9fb1e7f95ecb67281d7438f7c558bfd94cffcf77b
|
7
|
+
data.tar.gz: 60b7548a9df31906fe6ea209c1f4b7144fe48048b8a349173f52a4e663118bf485417a216edd4d1237f3d4bcc20c483a4f5b70e84db94754dc44bc82a541db5a
|
data/.travis.yml
CHANGED
data/README.md
CHANGED
@@ -96,6 +96,9 @@ Logster UI is built using [Ember.js](http://emberjs.com/)
|
|
96
96
|
5. Create a new Pull Request
|
97
97
|
|
98
98
|
# CHANGELOG
|
99
|
+
- 2016-07-11: Version 1.2.5
|
100
|
+
- Fix: Chained `Logster::Logger` logger now receives backtrace as well.
|
101
|
+
|
99
102
|
- 2016-05-05: Version 1.2.4
|
100
103
|
- Fix: XSS in log message show if attacker can inject script into ENV
|
101
104
|
|
data/lib/logster/logger.rb
CHANGED
@@ -16,15 +16,17 @@ module Logster
|
|
16
16
|
@chained << logger
|
17
17
|
end
|
18
18
|
|
19
|
-
def add_to_chained(logger, severity, message, progname, &block)
|
20
|
-
old = nil
|
19
|
+
def add_to_chained(logger, severity, message, progname, opts=nil, &block)
|
21
20
|
if logger.respond_to? :skip_store
|
22
21
|
old = logger.skip_store
|
23
22
|
logger.skip_store = @skip_store
|
24
23
|
end
|
25
24
|
|
26
|
-
logger.
|
27
|
-
|
25
|
+
if logger.is_a?(self.class)
|
26
|
+
logger.add(severity, message, progname, opts, &block)
|
27
|
+
else
|
28
|
+
logger.add(severity, message, progname, &block)
|
29
|
+
end
|
28
30
|
ensure
|
29
31
|
if logger.respond_to? :skip_store
|
30
32
|
logger.skip_store = old
|
@@ -47,7 +49,7 @@ module Logster
|
|
47
49
|
while i < @chained.length
|
48
50
|
# TODO double yielding blocks
|
49
51
|
begin
|
50
|
-
add_to_chained(@chained[i], severity, message, progname, &block)
|
52
|
+
add_to_chained(@chained[i], severity, message, progname, opts, &block)
|
51
53
|
rescue => e
|
52
54
|
# don't blow up if STDERR is somehow closed
|
53
55
|
STDERR.puts "Failed to report message to chained logger #{e}" rescue nil
|
data/lib/logster/version.rb
CHANGED
data/test/logster/test_logger.rb
CHANGED
@@ -30,6 +30,17 @@ class TestLogger < Minitest::Test
|
|
30
30
|
assert_match(/W,.*boom/, io.string)
|
31
31
|
end
|
32
32
|
|
33
|
+
def test_backtrace_with_chain
|
34
|
+
@other_store = TestStore.new
|
35
|
+
@logger.chain(Logster::Logger.new(@other_store))
|
36
|
+
|
37
|
+
@logger.add(0, "test", "prog", backtrace: "backtrace", env: {a: "x"})
|
38
|
+
|
39
|
+
[@store, @other_store].each do |store|
|
40
|
+
assert_equal "backtrace", store.calls[0][3][:backtrace]
|
41
|
+
end
|
42
|
+
end
|
43
|
+
|
33
44
|
class PlayLogger
|
34
45
|
attr_accessor :skip_store
|
35
46
|
def initialize(tester)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: logster
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- UI for viewing logs in Rack
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-07-11 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -216,3 +216,4 @@ test_files:
|
|
216
216
|
- test/logster/test_redis_rate_limiter.rb
|
217
217
|
- test/logster/test_redis_store.rb
|
218
218
|
- test/test_helper.rb
|
219
|
+
has_rdoc:
|