Skip to content

Commit 23ed5de

Browse files
authored
Merge pull request reidmorrison#189 from jschwertfeger/fix/active-job-nil-logger
fix: handle nil logger in `ActiveJob::Logging`
2 parents 1a5d5e4 + dc2d20f commit 23ed5de

File tree

1 file changed

+5
-1
lines changed
  • lib/rails_semantic_logger/extensions/active_job

1 file changed

+5
-1
lines changed

lib/rails_semantic_logger/extensions/active_job/logging.rb

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,11 @@ module Logging
99

1010
undef_method :tag_logger
1111
def tag_logger(*tags, &block)
12-
logger.tagged(*tags, &block)
12+
if logger.respond_to?(:tagged)
13+
logger.tagged(*tags, &block)
14+
else
15+
yield
16+
end
1317
end
1418
end
1519
end

0 commit comments

Comments
 (0)