From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-f196.google.com (mail-lj1-f196.google.com [209.85.208.196]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 49B8145BE2C for ; Wed, 3 Jun 2020 01:20:29 +0300 (MSK) Received: by mail-lj1-f196.google.com with SMTP id 9so202758ljc.8 for ; Tue, 02 Jun 2020 15:20:29 -0700 (PDT) From: Cyrill Gorcunov Date: Wed, 3 Jun 2020 01:18:16 +0300 Message-Id: <20200602221817.645015-12-gorcunov@gmail.com> In-Reply-To: <20200602221817.645015-1-gorcunov@gmail.com> References: <20200602221817.645015-1-gorcunov@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH v8 11/12] lua/log: use log_cfg instead of ffi's instances List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: tml To reduce number of ffi calls. Part-of #689 Suggested-by: Leonid Vasiliev Reviewed-by: Oleg Babin Signed-off-by: Cyrill Gorcunov --- src/lua/log.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lua/log.lua b/src/lua/log.lua index 50c96a8d2..161f403db 100644 --- a/src/lua/log.lua +++ b/src/lua/log.lua @@ -161,7 +161,7 @@ local function log_level_list() end local function say(level, fmt, ...) - if ffi.C.log_level < level then + if log_cfg.level < level then -- don't waste cycles on debug.getinfo() return end @@ -179,7 +179,7 @@ local function say(level, fmt, ...) fmt[field] = nil end fmt = json.encode(fmt) - if ffi.C.log_format == ffi.C.SF_JSON then + if log_cfg.format == fmt_num2str[ffi.C.SF_JSON] then -- indicate that message is already encoded in JSON format = fmt_num2str[ffi.C.SF_JSON] end -- 2.26.2