Skip to content

Commit

Permalink
Sacrifice for the linting gods
Browse files Browse the repository at this point in the history
  • Loading branch information
marcotc committed Apr 27, 2022
1 parent ae2fef3 commit 2294299
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions lib/datadog/tracing/contrib/rails/patcher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -83,15 +83,17 @@ def add_logger(app)
# if so, add proc that injects trace identifiers for tagged logging.
logger = app.config.logger || ::Rails.logger

if (logger) \
if logger \
&& defined?(::ActiveSupport::TaggedLogging) \
&& logger.is_a?(::ActiveSupport::TaggedLogging)

Contrib::Rails::LogInjection.add_as_tagged_logging_logger(app)
should_warn = false
end

Datadog.logger.warn("Unable to enable Datadog Trace context, Logger #{logger.class} is not supported") if should_warn
if should_warn
Datadog.logger.warn("Unable to enable Datadog Trace context, Logger #{logger.class} is not supported")
end
end

def patch_after_intialize
Expand Down

0 comments on commit 2294299

Please sign in to comment.