Skip to content

Commit

Permalink
Merge pull request #189 from jschwertfeger/fix/active-job-nil-logger
Browse files Browse the repository at this point in the history
fix: handle nil logger in `ActiveJob::Logging`
  • Loading branch information
reidmorrison authored Nov 9, 2023
2 parents 1a5d5e4 + dc2d20f commit 23ed5de
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion lib/rails_semantic_logger/extensions/active_job/logging.rb
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,11 @@ module Logging

undef_method :tag_logger
def tag_logger(*tags, &block)
logger.tagged(*tags, &block)
if logger.respond_to?(:tagged)
logger.tagged(*tags, &block)
else
yield
end
end
end
end

0 comments on commit 23ed5de

Please sign in to comment.