def initialize(options = {})
location = options[:location] || 'log/boxgrinder.log'
threshold = options[:level].nil? ? :info : options[:level].to_sym
type = options[:type] || [:stdout, :file]
unless type.is_a?(Array)
type = [type.to_s.to_sym]
end
threshold = THRESHOLDS[threshold.to_sym] unless threshold.nil?
formatter = Logger::Formatter.new
if type.include?(:file)
FileUtils.mkdir_p(File.dirname(location))
@file_log = Logger.new(location, 10, 1024000)
@file_log.level = Logger::TRACE
@file_log.formatter = formatter
end
if type.include?(:stdout)
@stdout_log = Logger.new(STDOUT.dup)
@stdout_log.level = threshold || Logger::INFO
@stdout_log.formatter = formatter
end
end