From 474b92208978076447428745ca1c8eb03b56e323 Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Tue, 24 Sep 2019 17:33:19 +0200 Subject: [PATCH] Be consistent : either we use log() everywhere or we don't ... But imho just logger.info() is fine --- helpers.lua | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/helpers.lua b/helpers.lua index 685c5aa..dece676 100644 --- a/helpers.lua +++ b/helpers.lua @@ -12,10 +12,6 @@ local conf = config.get_config() local logger = require("log") logger.outfile = "/var/log/nginx/ssowat.log" -function log(...) - logger.info(...) -end - -- Read a FS stored file function read_file(file) local f = io.open(file, "rb") @@ -164,7 +160,7 @@ function set_auth_cookie(user, domain) "SSOwAuthHash="..hash..cookie_str, "SSOwAuthExpire="..expire..cookie_str } - log("Hash "..hash.." generated for "..user.."@"..ngx.var.remote_addr) + logger.info("Hash "..hash.." generated for "..user.."@"..ngx.var.remote_addr) end @@ -228,7 +224,7 @@ function is_logged_in() "|"..expireTime.. "|"..session_key) if hash ~= authHash then - log("Hash "..authHash.." rejected for "..user.."@"..ngx.var.remote_addr) + logger.info("Hash "..authHash.." rejected for "..user.."@"..ngx.var.remote_addr) end return hash == authHash end