diff options
author | Martin Gütlein <martin.guetlein@gmail.com> | 2010-03-26 11:23:15 +0100 |
---|---|---|
committer | Martin Gütlein <martin.guetlein@gmail.com> | 2010-03-26 11:23:15 +0100 |
commit | 7b8d85cb91c0a0a6ec530fc527be6ec67f70df99 (patch) | |
tree | 05fac83528f95542d57c1e756c5db874f37ee073 /lib/environment.rb | |
parent | 0230d687322bab8c0fd24cf41e33a28554a364db (diff) |
changes related to feature-encode-problem
Diffstat (limited to 'lib/environment.rb')
-rw-r--r-- | lib/environment.rb | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/environment.rb b/lib/environment.rb index 2838c29..e784777 100644 --- a/lib/environment.rb +++ b/lib/environment.rb @@ -40,6 +40,14 @@ if @@config[:database] end end +class Sinatra::Base + # overwriting halt to log halts (!= 202) + def halt(status,msg) + LOGGER.error "halt "+status.to_s+" "+msg.to_s if (status != 202) + throw :halt, [status, msg] + end +end + # logging class MyLogger < Logger @@ -57,7 +65,7 @@ class MyLogger < Logger n = 2 line = lines[n] - while (line =~ /spork.rb/ or line =~ /as_task/) + while (line =~ /spork.rb/ or line =~ /as_task/ or line =~ /environment.rb/) #puts "skip line "+line.to_s n += 1 line = lines[n] |