Sha256: f212b01e4e9a7c30cb2cc56528c8fae2e1b23cddcfe618ce99bcb9613ec5d1bd

Contents?: true

Size: 722 Bytes

Versions: 1

Compression:

Stored size: 722 Bytes

Contents

rad.register :logger do
  if defined?(SILENCE_LOGGER)
    logger = Logger.new nil
  else
    config = rad[:config]
    if config and config.runtime_dir? and File.exist?("#{config.runtime_dir}/log")
      logger = ActiveSupport::BufferedLogger.new rad.config.log_path
      logger.level = ActiveSupport::BufferedLogger.const_get config.log_level.to_s.upcase      
      # logger.auto_flushing = false if config.production? and !config.stdout_logger(false)
    elsif config and config.test?
      logger = Logger.new nil
    elsif config
      logger = Logger.new STDOUT
      logger.warn "No log folder!"
    else
      logger = Logger.new STDOUT
      logger.warn "Config not initialized!"
    end    
  end  
  logger
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
rad_core-0.0.13 lib/rad/environment/logger.rb