honeybadger 3.0.1 → 3.0.2

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: 3d16cc74df6e36fd6a8910440d955a5900880334
4
- data.tar.gz: 0a01565f35dad7683e74386700be5e2ef6a0bb5f
3
+ metadata.gz: 5647cdda642ecdd3cfcb52c96fa63c3329a6d463
4
+ data.tar.gz: 8e7da9cdbe2667fdc645df75b24741a6a546eeea
5
5
  SHA512:
6
- metadata.gz: f09e0ca1bb1a6954a4a56c96cdeb61159c68b209d30628fc4c73775f2a34e098772c39d29bbb9cab3ed166b92ea92c7d14ef2f2c9f5903364b45d7959d074299
7
- data.tar.gz: 54c00e98c86f809a9dc0d7f63ccc1a4581b539edd31ac3c2807d659eb3f5ead05d0e9718ee75ae534890dae494ebecfd1f6129f5f2ff633d0c046573dba1efdb
6
+ metadata.gz: 60f07bbbed2909e125b64bd264afee0cc1b074f7801d952e84334f9c3b7428873d5e28fe71b5ecbc45893fbb548d2fa5631add3ccc1726f6d38d3cd8a8432563
7
+ data.tar.gz: 56d3c3d619c7a3e25cc1fb13bb4ef2fe1492efd861a24b94ab2df065ad7098bf7ec1b4d74022a6dd50badde94ceccc2559b51123ab9a5eb56795dd307a6d606b
data/CHANGELOG.md CHANGED
@@ -5,6 +5,10 @@ adheres to [Semantic Versioning](http://semver.org/).
5
5
 
6
6
  ## [Unreleased]
7
7
 
8
+ ## [3.0.2] - 2017-02-16
9
+ ### Fixed
10
+ - Fixed a bug caused by an interaction with the semantic\_logger gem.
11
+
8
12
  ## [3.0.1] - 2017-02-10
9
13
  ### Fixed
10
14
  - Fixed a bug which caused a NoMethodError (undefined method \`start_with?') when
@@ -7,28 +7,23 @@ module Honeybadger
7
7
  ::Sinatra::Base.class_eval do
8
8
  class << self
9
9
  def build_with_honeybadger(*args, &block)
10
+ configure_honeybadger
10
11
  install_honeybadger
11
12
  build_without_honeybadger(*args, &block)
12
13
  end
13
14
  alias :build_without_honeybadger :build
14
15
  alias :build :build_with_honeybadger
15
16
 
16
- def honeybadger_config(app)
17
- {
18
- api_key: defined?(honeybadger_api_key) ? honeybadger_api_key : nil,
19
- env: ENV['APP_ENV'] || ENV['RACK_ENV'],
20
- framework: :sinatra,
21
- :'logging.path' => 'STDOUT'
22
- }
17
+ def configure_honeybadger
18
+ return unless defined?(honeybadger_api_key)
19
+ Honeybadger.configure do |config|
20
+ config.api_key = honeybadger_api_key
21
+ end
23
22
  end
24
23
 
25
24
  def install_honeybadger
26
- Honeybadger.init!(honeybadger_config(self))
27
- Honeybadger.load_plugins!
28
-
29
25
  config = Honeybadger.config
30
26
  return unless config[:'sinatra.enabled']
31
-
32
27
  install_honeybadger_middleware(Honeybadger::Rack::ErrorNotifier) if config[:'exceptions.enabled']
33
28
  end
34
29
 
@@ -41,3 +36,11 @@ module Honeybadger
41
36
  end
42
37
  end
43
38
  end
39
+
40
+ Honeybadger.init!({
41
+ env: ENV['APP_ENV'] || ENV['RACK_ENV'],
42
+ framework: :sinatra,
43
+ :'logging.path' => 'STDOUT'
44
+ })
45
+
46
+ Honeybadger.load_plugins!
@@ -1,6 +1,7 @@
1
1
  require 'logger'
2
2
  require 'singleton'
3
3
  require 'delegate'
4
+ require 'forwardable'
4
5
 
5
6
  module Honeybadger
6
7
  module Logging
@@ -20,19 +21,19 @@ module Honeybadger
20
21
  alias :d :debug
21
22
 
22
23
  def info(msg = nil)
23
- return true if Logger::Severity::INFO < logger.level
24
+ return true unless logger.info?
24
25
  msg = yield if block_given?
25
26
  logger.info(msg)
26
27
  end
27
28
 
28
29
  def warn(msg = nil)
29
- return true if Logger::Severity::WARN < logger.level
30
+ return true unless logger.warn?
30
31
  msg = yield if block_given?
31
32
  logger.warn(msg)
32
33
  end
33
34
 
34
35
  def error(msg = nil)
35
- return true if Logger::Severity::ERROR < logger.level
36
+ return true unless logger.error?
36
37
  msg = yield if block_given?
37
38
  logger.error(msg)
38
39
  end
@@ -47,6 +48,10 @@ module Honeybadger
47
48
  define_method severity.downcase do |msg|
48
49
  add(Logger::Severity.const_get(severity), msg)
49
50
  end
51
+
52
+ define_method :"#{severity.downcase}?" do
53
+ true
54
+ end
50
55
  end
51
56
 
52
57
  def add(severity, msg)
@@ -78,6 +83,8 @@ module Honeybadger
78
83
  end
79
84
 
80
85
  class StandardLogger < Base
86
+ extend Forwardable
87
+
81
88
  def initialize(logger = Logger.new('/dev/null'))
82
89
  raise ArgumentError, 'logger not specified' unless logger
83
90
  raise ArgumentError, 'logger must be a logger' unless logger.respond_to?(:add)
@@ -85,13 +92,7 @@ module Honeybadger
85
92
  @logger = logger
86
93
  end
87
94
 
88
- def add(severity, msg)
89
- @logger.add(severity, msg)
90
- end
91
-
92
- def level
93
- @logger.level
94
- end
95
+ def_delegators :@logger, :level, :add, :debug?, :info?, :warn?, :error?
95
96
  end
96
97
 
97
98
  class FormattedLogger < StandardLogger
@@ -1,4 +1,4 @@
1
1
  module Honeybadger
2
2
  # Public: The current String Honeybadger version.
3
- VERSION = '3.0.1'.freeze
3
+ VERSION = '3.0.2'.freeze
4
4
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: honeybadger
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.1
4
+ version: 3.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Honeybadger Industries LLC
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-10 00:00:00.000000000 Z
11
+ date: 2017-02-16 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Make managing application errors a more pleasant experience.
14
14
  email: