add logging option in Locomotive settings

This commit is contained in:
dinedine 2010-06-11 11:29:51 +02:00
parent fe96fbdaa2
commit 1d5786638b
3 changed files with 4 additions and 1 deletions

View File

@ -4,4 +4,5 @@ require File.dirname(__FILE__) + '/../../lib/core_ext.rb'
Locomotive.configure do |config|
config.default_domain = 'example.com'
config.lastest_items_nb = 5
config.enable_logs = true
end

View File

@ -8,7 +8,8 @@ module Locomotive
# :forbidden_paths => %w{layouts snippets stylesheets javascripts assets admin system api},
:reserved_slugs => %w{stylesheets javascripts assets admin images api pages},
:locales => %w{en fr},
:cookie_key => '_locomotive_session'
:cookie_key => '_locomotive_session',
:enable_logs => false
}
cattr_accessor :settings

View File

@ -19,6 +19,7 @@ module Locomotive
protected
def fetch_site
logger.info "[fetch site] host = #{request.host} / #{request.env['HTTP_HOST']}" if Locomotive.config.enable_logs
@current_site ||= Site.match_domain(request.host).first
end