From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp51.i.mail.ru (smtp51.i.mail.ru [94.100.177.111]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id A99834696C1 for ; Tue, 2 Jun 2020 10:52:59 +0300 (MSK) From: Oleg Babin References: <20200601222507.560415-1-gorcunov@gmail.com> <20200601222507.560415-12-gorcunov@gmail.com> Message-ID: Date: Tue, 2 Jun 2020 10:52:54 +0300 MIME-Version: 1.0 In-Reply-To: <20200601222507.560415-12-gorcunov@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Subject: Re: [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: Cyrill Gorcunov , tml Hi! Thanks for your patch. LGTM. On 02/06/2020 01:25, Cyrill Gorcunov wrote: > 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 >