Skip to content

Commit

Permalink
Make logging an option. Logging is turned on by default.
Browse files Browse the repository at this point in the history
  • Loading branch information
Markus Prinz committed Apr 7, 2008
1 parent 081f71e commit 80d4bec
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions lib/sinatra.rb
Expand Up @@ -114,13 +114,9 @@ def env
end

def build_application
app = if Sinatra.options.sessions == true
Rack::Session::Cookie.new(application)
else
application
end

Rack::CommonLogger.new(app)
app = application
app = Rack::Session::Cookie.new(app) if Sinatra.options.sessions == true
app = Rack::CommonLogger.new(app) if Sinatra.options.logging == true
end

def run
Expand Down Expand Up @@ -632,6 +628,7 @@ def self.default_options
:views => Dir.pwd + '/views',
:public => Dir.pwd + '/public',
:sessions => false,
:logging => true,
}
end

Expand Down

0 comments on commit 80d4bec

Please sign in to comment.