Last active
December 23, 2015 12:49
-
-
Save silasb/6638155 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GEM | |
remote: https://rubygems.org/ | |
specs: | |
coderay (1.0.9) | |
haml (3.1.4) | |
i18n (0.6.0) | |
json (1.8.0) | |
mail (2.3.0) | |
i18n (>= 0.4.0) | |
mime-types (~> 1.16) | |
treetop (~> 1.4.8) | |
method_source (0.8.1) | |
mime-types (1.19) | |
mysql2 (0.3.13) | |
polyglot (0.3.2) | |
pry (0.9.12.2) | |
coderay (~> 1.0.5) | |
method_source (~> 0.8) | |
slop (~> 3.4) | |
rack (1.5.2) | |
rack-protection (1.5.0) | |
rack | |
sequel (3.30.0) | |
sinatra (1.4.3) | |
rack (~> 1.4) | |
rack-protection (~> 1.4) | |
tilt (~> 1.3, >= 1.3.4) | |
slop (3.4.5) | |
tilt (1.4.1) | |
treetop (1.4.10) | |
polyglot | |
polyglot (>= 0.3.1) | |
PLATFORMS | |
ruby | |
DEPENDENCIES | |
haml | |
json | |
mysql2 (~> 0.3) | |
pry | |
sequel | |
sinatra |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require 'bundler' | |
Bundler.require | |
require 'logger' | |
require 'provider' | |
class LoggerMiddleWare | |
def initialize(app, logger) | |
@app, @logger = app, logger | |
end | |
def call(env) | |
env['rack.errors'] = @logger.instance_variable_get('@logdev') | |
@app.call(env) | |
end | |
end | |
logger = Logger.new('log/app.log', 'weekly') | |
use LoggerMiddleWare, logger | |
run Provider.new |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment