Skip to content

Commit b5a03bd

Browse files
authored
Merge pull request reidmorrison#272 from 0robustus1/avoid-failing-in-no-assets-mode
avoid crashing in no assets (api only) mode
2 parents e282f3d + 0f0886b commit b5a03bd

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/rails_semantic_logger/engine.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ class Engine < ::Rails::Engine
204204
RailsSemanticLogger::Rack::Logger.started_request_log_level = :info if config.rails_semantic_logger.started
205205

206206
# Silence asset logging by applying a filter to the Rails logger itself, not any of the appenders.
207-
if config.rails_semantic_logger.quiet_assets && config.assets.prefix
207+
if config.rails_semantic_logger.quiet_assets && config.respond_to?(:assets) && config.assets.prefix
208208
assets_root = config.relative_url_root.to_s + config.assets.prefix
209209
assets_regex = %r(\A/{0,2}#{assets_root})
210210
RailsSemanticLogger::Rack::Logger.logger.filter = ->(log) { log.payload[:path] !~ assets_regex if log.payload }

0 commit comments

Comments
 (0)