Skip to content

Commit

Permalink
Do not auto-add console logger when one already exists
Browse files Browse the repository at this point in the history
  • Loading branch information
reidmorrison committed Oct 7, 2021
1 parent 6684880 commit 7cf794f
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion lib/rails_semantic_logger/engine.rb
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,8 @@ class Engine < ::Rails::Engine
console do |_app|
# Don't use a background thread for logging
SemanticLogger.sync!
if config.rails_semantic_logger.console_logger
# Add a stderr logger when running inside a Rails console unless one has already been added.
if config.rails_semantic_logger.console_logger && !SemanticLogger::Logger.processor.appenders.console_output?
SemanticLogger.add_appender(io: STDERR, formatter: :color)
end

Expand Down

0 comments on commit 7cf794f

Please sign in to comment.