From 0e56285f697ac9464c4c939c1d3020f07992d773 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Alexis=20Laferri=C3=A8re?= Date: Thu, 17 Mar 2016 12:00:15 -0400 Subject: [PATCH] lib/nitcorn: oneline the log on prepare_reponse_and_close MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Alexis Laferrière --- lib/nitcorn/log.nit | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/nitcorn/log.nit b/lib/nitcorn/log.nit index c0d6d52..41e0ab9 100644 --- a/lib/nitcorn/log.nit +++ b/lib/nitcorn/log.nit @@ -27,16 +27,16 @@ redef class Action super return end - print """{{{class_name}}} enter: -uri="{{{truncated_uri}}}" -query="{{{request.query_string}}}" -body:{{{request.body.length}}} bytes""" + + print "{http_server.remote_address}: {class_name} prepare for url:'{request.url}' body:'{request.body}' cookie:'{request.cookie.join(",", ":")}'" + var clock = new Clock + super + var perf = sys.perfs[class_name] perf.add(clock.lapse) if perf.count % perfs_print_period == 0 then print "{class_name} perfs: {perf}:" - print "{class_name} return: uri={truncated_uri}" end end @@ -52,7 +52,7 @@ redef fun print_error(object) do "{timestamp.hour}:{timestamp.min}:{timestamp.sec}: {object}" end -# Should the actions be logged ? +# Should the actions be logged? This may log sensitive data. fun log_nitcorn_actions: Bool do return false # Number of actions executed before printing the perfs -- 1.7.9.5