From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-f195.google.com (mail-lj1-f195.google.com [209.85.208.195]) (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 1A82D45BE2E for ; Tue, 2 Jun 2020 01:27:17 +0300 (MSK) Received: by mail-lj1-f195.google.com with SMTP id o9so10174869ljj.6 for ; Mon, 01 Jun 2020 15:27:17 -0700 (PDT) From: Cyrill Gorcunov Date: Tue, 2 Jun 2020 01:25:07 +0300 Message-Id: <20200601222507.560415-12-gorcunov@gmail.com> In-Reply-To: <20200601222507.560415-1-gorcunov@gmail.com> References: <20200601222507.560415-1-gorcunov@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH v7 11/11] 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 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 3376932ff..7ca206989 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