pliny 0.16.0 → 0.16.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/pliny.rb +1 -0
- data/lib/pliny/rollbar_logger.rb +23 -0
- data/lib/pliny/version.rb +1 -1
- data/lib/template/config/initializers/rollbar.rb +2 -0
- data/spec/rollbar_logger_spec.rb +44 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 215a2ad7a3f04331fc7f30589fbfb65ba259fe92
|
4
|
+
data.tar.gz: 9aaccd16d6d4e5284154747ed90936b8f787b0be
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7446fc7067621c604683a566d5f6daa06c578a302af5e6aab6b881c8911ac6f63ca3401882ab8c26168c08f00ac006c859da33fec97e51d00ea0f88bbeaf7274
|
7
|
+
data.tar.gz: 6d1c7d86a2727a3318cd78a9679ae5452229682ba7b7a2b4aaaec6a6c9d8c66e407a9b16d3e8627b03fd88263275ba3ec5ebe4c494f3d39dd0b4095568b5d804
|
data/lib/pliny.rb
CHANGED
@@ -8,6 +8,7 @@ require_relative "pliny/helpers/params"
|
|
8
8
|
require_relative "pliny/helpers/serialize"
|
9
9
|
require_relative "pliny/log"
|
10
10
|
require_relative "pliny/request_store"
|
11
|
+
require_relative "pliny/rollbar_logger"
|
11
12
|
require_relative "pliny/router"
|
12
13
|
require_relative "pliny/utils"
|
13
14
|
require_relative "pliny/middleware/cors"
|
@@ -0,0 +1,23 @@
|
|
1
|
+
module Pliny
|
2
|
+
class RollbarLogger
|
3
|
+
def debug(message)
|
4
|
+
log('debug', message)
|
5
|
+
end
|
6
|
+
|
7
|
+
def info(message)
|
8
|
+
log('info', message)
|
9
|
+
end
|
10
|
+
|
11
|
+
def warn(message)
|
12
|
+
log('warn', message)
|
13
|
+
end
|
14
|
+
|
15
|
+
def error(message)
|
16
|
+
log('error', message)
|
17
|
+
end
|
18
|
+
|
19
|
+
def log(level, message)
|
20
|
+
Pliny.log(rollbar: true, level: level, message: message)
|
21
|
+
end
|
22
|
+
end
|
23
|
+
end
|
data/lib/pliny/version.rb
CHANGED
@@ -0,0 +1,44 @@
|
|
1
|
+
require "spec_helper"
|
2
|
+
|
3
|
+
describe Pliny::RollbarLogger do
|
4
|
+
subject(:logger) { Pliny::RollbarLogger.new }
|
5
|
+
|
6
|
+
let(:message) { 'hello world' }
|
7
|
+
let(:log_context) { { rollbar: true, level: level, message: message } }
|
8
|
+
|
9
|
+
before do
|
10
|
+
mock(Pliny).log(log_context)
|
11
|
+
end
|
12
|
+
|
13
|
+
context '#debug' do
|
14
|
+
let(:level) { 'debug' }
|
15
|
+
|
16
|
+
it "proxies the debug log level" do
|
17
|
+
logger.debug(message)
|
18
|
+
end
|
19
|
+
end
|
20
|
+
|
21
|
+
context '#info' do
|
22
|
+
let(:level) { 'info' }
|
23
|
+
|
24
|
+
it "proxies the info log level" do
|
25
|
+
logger.info(message)
|
26
|
+
end
|
27
|
+
end
|
28
|
+
|
29
|
+
context '#warn' do
|
30
|
+
let(:level) { 'warn' }
|
31
|
+
|
32
|
+
it "proxies the warn log level" do
|
33
|
+
logger.warn(message)
|
34
|
+
end
|
35
|
+
end
|
36
|
+
|
37
|
+
context '#error' do
|
38
|
+
let(:level) { 'error' }
|
39
|
+
|
40
|
+
it "proxies the error log level" do
|
41
|
+
logger.error(message)
|
42
|
+
end
|
43
|
+
end
|
44
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pliny
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.16.
|
4
|
+
version: 0.16.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brandur Leach
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2016-04-
|
12
|
+
date: 2016-04-16 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -366,6 +366,7 @@ files:
|
|
366
366
|
- lib/pliny/middleware/rescue_errors.rb
|
367
367
|
- lib/pliny/middleware/versioning.rb
|
368
368
|
- lib/pliny/request_store.rb
|
369
|
+
- lib/pliny/rollbar_logger.rb
|
369
370
|
- lib/pliny/router.rb
|
370
371
|
- lib/pliny/tasks.rb
|
371
372
|
- lib/pliny/tasks/db.rake
|
@@ -450,6 +451,7 @@ files:
|
|
450
451
|
- spec/middleware/rescue_errors_spec.rb
|
451
452
|
- spec/middleware/versioning_spec.rb
|
452
453
|
- spec/request_store_spec.rb
|
454
|
+
- spec/rollbar_logger_spec.rb
|
453
455
|
- spec/router_spec.rb
|
454
456
|
- spec/spec_helper.rb
|
455
457
|
- spec/support/config.rb
|