Sha256: cbd8e770eeae7bf391af04d2656f386edcb4bf6405d745a3c8465247edb3e7dc

Contents?: true

Size: 649 Bytes

Versions: 2

Compression:

Stored size: 649 Bytes

Contents

class Pancake::PancakeConfig
  default :log_path,        Proc.new{ "log/pancake_#{Pancake.env}.log"}
  default :log_level,       :info
  default :log_delimiter,   " ~ "
  default :log_auto_flush,  true
  default :log_to_file,     Proc.new{ Pancake.env == "production" }
  default :log_stream,      Proc.new{ _log_stream }

  def _log_stream
    if Pancake.configuration.log_to_file
      log_dir = File.expand_path(File.join(Pancake.root, File.dirname(log_path)))
      FileUtils.mkdir_p(log_dir)
      File.join(log_dir, File.basename(log_path))
    else
      STDOUT
    end
  end

  def reset_log_stream!
    values.delete(:log_stream)
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
pancake-0.1.10 lib/pancake/defaults/configuration.rb
pancake-0.1.8 lib/pancake/defaults/configuration.rb