Skip to content

Commit

Permalink
fix(deps): resolve deprecation warning under Ruby 2.7
Browse files Browse the repository at this point in the history
Ruby 3.x ended up not being fully as strict as the deprecation warnings
in 2.7 hint at, but I believe it's still good to avoid deprecation
warnings and ambiguity.
  • Loading branch information
jimeh committed Jul 24, 2023
1 parent 3cf7a0c commit 8b2c2c9
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions lib/klogger/logger.rb
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,14 @@ def initialize(name = nil, destination: $stdout, formatter: :go, highlight: fals
end

def exception(exception, message = nil, **tags)
error({ message: message,
exception: exception.class.name,
exception_message: exception.message,
backtrace: exception.backtrace[0, 4].join("\n") }.merge(tags))
error(
**{
message: message,
exception: exception.class.name,
exception_message: exception.message,
backtrace: exception.backtrace[0, 4].join("\n")
}.merge(tags)
)
end

LEVELS.each do |level|
Expand Down

0 comments on commit 8b2c2c9

Please sign in to comment.