lib/volt/server/rack/quiet_common_logger.rb in volt-0.9.3.pre6 vs lib/volt/server/rack/quiet_common_logger.rb in volt-0.9.3

- old
+ new

@@ -14,19 +14,22 @@ ext = base.split('.').last else ext = nil end + @logged = false + body = BodyProxy.new(body) do # Don't log on ignored extensions - unless @@ignore_extensions.include?(ext) + if !@@ignore_extensions.include?(ext) && !@logged log(env, status, header, began_at) end end # Because of web sockets, the initial request doesn't finish, so we # can just trigger it now. unless ext || path.start_with?('/channel') + @logged = true log(env, status, header, began_at) end [status, header, body] end