Allow logging to be sent to a file

In config.rb, you can write:

logger 'middleman.log'
This commit is contained in:
Ben Hollis 2013-10-19 19:54:57 -07:00
parent e773e8c1a9
commit 12de88e8d7
2 changed files with 8 additions and 6 deletions

View file

@ -48,6 +48,9 @@ module Middleman
# @return [Middleman::Logger] The logger
def self.logger(*args)
if !@_logger || args.length > 0
if args.length == 1 && (args.first.is_a?(::String) || args.first.respond_to?(:write))
args = [0, false, args.first]
end
@_logger = ::Middleman::Logger.new(*args)
end