Use centralized Logger and add instrument methods

This commit is contained in:
Thomas Reynolds 2012-07-15 11:04:45 -07:00
parent 95339dad23
commit de6d7980ac
15 changed files with 126 additions and 61 deletions

View file

@ -4,6 +4,7 @@ require "tilt"
# Use ActiveSupport JSON
require "active_support/json"
require "active_support/core_ext/integer/inflections"
require "active_support/core_ext/float/rounding"
# Simple callback library
require "middleman-core/vendor/hooks-0.2.0/lib/hooks"
@ -17,7 +18,7 @@ module Middleman
class Application
# Uses callbacks
include Hooks
# Before request hook
define_hook :before
@ -85,10 +86,6 @@ module Middleman
# @return [String]
set :environment, (ENV['MM_ENV'] && ENV['MM_ENV'].to_sym) || :development
# Whether logging is active, disabled by default
# @return [String]
set :logging, false
# Which file should be used for directory indexes
# @return [String]
set :index_file, "index.html"
@ -227,13 +224,8 @@ module Middleman
def settings
self
end
# Whether we're logging
#
# @return [Boolean] If we're logging
def logging?
logging
end
delegate :logger, :instrument, :to => ::Middleman::Util
# Work around this bug: http://bugs.ruby-lang.org/issues/4521
# where Ruby will call to_s/inspect while printing exception