Flush io buffer after each write to log (#554)
This commit is contained in:
parent
c893172fbf
commit
a4bdecdc7d
1 changed files with 3 additions and 0 deletions
|
@ -8,11 +8,14 @@ module Kemal
|
|||
elapsed_time = Time.measure { call_next(context) }
|
||||
elapsed_text = elapsed_text(elapsed_time)
|
||||
@io << Time.utc << ' ' << context.response.status_code << ' ' << context.request.method << ' ' << context.request.resource << ' ' << elapsed_text << '\n'
|
||||
@io.flush
|
||||
context
|
||||
end
|
||||
|
||||
def write(message : String)
|
||||
@io << message
|
||||
@io.flush
|
||||
@io
|
||||
end
|
||||
|
||||
private def elapsed_text(elapsed)
|
||||
|
|
Loading…
Reference in a new issue