Skip to content

Commit

Permalink
Fall back to a sane logger if none configured
Browse files Browse the repository at this point in the history
Makes padrino fall back to the production logger
if there is no logger config given. Emits a warning.
  • Loading branch information
skade committed Jul 15, 2011
1 parent e3ff9ca commit cce0719
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions padrino-core/lib/padrino-core/logger.rb
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,12 @@ class Logger
def self.setup!
config_level = (PADRINO_LOG_LEVEL || Padrino.env || :test).to_sym # need this for PADRINO_LOG_LEVEL
config = Config[config_level]

unless config
warn("No logging configuration for :#{config_level} found, falling back to :production")
config = Config[:production]
end

stream = case config[:stream]
when :to_file
FileUtils.mkdir_p(Padrino.root("log")) unless File.exists?(Padrino.root("log"))
Expand Down

0 comments on commit cce0719

Please sign in to comment.