Skip to content

Commit

Permalink
Fix compatibility for Ruby Logger 1.6.0
Browse files Browse the repository at this point in the history
The way the Ruby Logger fetches the level now wasn't compatible with our
logger. This commit adds an attribute reader for our log level to skip
the Ruby Logger's current logic. This change works with olders version
as it just replicates the behaviour prior to 1.6.
  • Loading branch information
luismiramirez committed Dec 27, 2023
1 parent 4bc79a2 commit a5963f6
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions .changesets/fix-ruby-logger-1-6-0-compatibility.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
---
bump: "patch"
type: "fix"
---

Fix Ruby Logger 1.6.0 compatibility
4 changes: 2 additions & 2 deletions lib/appsignal/logger.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ class Logger < ::Logger
FATAL => 7
}.freeze

attr_reader :level

# Create a new logger instance
#
# @param group Name of the group for this logger.
Expand All @@ -25,8 +27,6 @@ class Logger < ::Logger
def initialize(group, level: INFO, format: PLAINTEXT)
raise TypeError, "group must be a string" unless group.is_a? String

super(group, :level => level)

@group = group
@level = level
@format = format
Expand Down

0 comments on commit a5963f6

Please sign in to comment.