mirror of
https://gitea.invidious.io/iv-org/shard-kemal.git
synced 2024-08-15 00:53:36 +00:00
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_time = Time.measure { call_next(context) }
|
||||||
elapsed_text = elapsed_text(elapsed_time)
|
elapsed_text = elapsed_text(elapsed_time)
|
||||||
@io << Time.utc << ' ' << context.response.status_code << ' ' << context.request.method << ' ' << context.request.resource << ' ' << elapsed_text << '\n'
|
@io << Time.utc << ' ' << context.response.status_code << ' ' << context.request.method << ' ' << context.request.resource << ' ' << elapsed_text << '\n'
|
||||||
|
@io.flush
|
||||||
context
|
context
|
||||||
end
|
end
|
||||||
|
|
||||||
def write(message : String)
|
def write(message : String)
|
||||||
@io << message
|
@io << message
|
||||||
|
@io.flush
|
||||||
|
@io
|
||||||
end
|
end
|
||||||
|
|
||||||
private def elapsed_text(elapsed)
|
private def elapsed_text(elapsed)
|
||||||
|
|
Loading…
Reference in a new issue