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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 08654f14252194c24da252d65fc61aa55ea2765c
4
- data.tar.gz: f60b617b6c791b53b9eba29dd7d8bc5e575ef9e7
3
+ metadata.gz: 215a2ad7a3f04331fc7f30589fbfb65ba259fe92
4
+ data.tar.gz: 9aaccd16d6d4e5284154747ed90936b8f787b0be
5
5
  SHA512:
6
- metadata.gz: 285d993e5753fe66fc746d976feba2407e913f693ec4d5c496ccbfc9e122ba1c41424c1736254c9e1872d84b5f3d7681eb468a4b8cd42c481722feb10811fddc
7
- data.tar.gz: c7a8efb057eda7f0a6a6fc98b2dc0f9bb07642691ea1b83fded395c33a70f4d8a021172cfa6c443bdcf137f080e5c1b6d1cad749e193f0aec523e6ed9d5b4fe4
6
+ metadata.gz: 7446fc7067621c604683a566d5f6daa06c578a302af5e6aab6b881c8911ac6f63ca3401882ab8c26168c08f00ac006c859da33fec97e51d00ea0f88bbeaf7274
7
+ data.tar.gz: 6d1c7d86a2727a3318cd78a9679ae5452229682ba7b7a2b4aaaec6a6c9d8c66e407a9b16d3e8627b03fd88263275ba3ec5ebe4c494f3d39dd0b4095568b5d804
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Pliny
2
- VERSION = "0.16.0"
2
+ VERSION = "0.16.1"
3
3
  end
@@ -1,6 +1,8 @@
1
1
  Rollbar.configure do |config|
2
2
  config.enabled = ENV.has_key?('ROLLBAR_ACCESS_TOKEN')
3
3
  config.access_token = ENV["ROLLBAR_ACCESS_TOKEN"]
4
+ config.environment = ENV['ROLLBAR_ENV']
5
+ config.logger = Pliny::RollbarLogger.new
4
6
  config.use_sucker_punch
5
7
  end
6
8
 
@@ -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.0
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-14 00:00:00.000000000 Z
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