lib/berkeley_library/logging/configurator.rb in berkeley_library-logging-0.2.6.2 vs lib/berkeley_library/logging/configurator.rb in berkeley_library-logging-0.2.7
- old
+ new
@@ -6,16 +6,20 @@
module BerkeleyLibrary
module Logging
class Configurator
class << self
+ # Applies the log configuration to the specified Rails config.
+ #
+ # @return [BerkeleyLibrary::Logging::Logger] the configured logger
def configure(config)
configure_lograge(config)
- logger = Loggers.new_default_logger(config)
- logger.info("Custom logger initialized for environment #{Logging.env.inspect}")
- configure_webpacker(logger)
- config.logger = logger
+ Loggers.new_default_logger(config).tap do |logger|
+ logger.info("Custom logger initialized for environment #{Logging.env.inspect}")
+ configure_webpacker(logger)
+ config.logger = logger
+ end
end
private
def configure_lograge(config)