[Tarantool-patches] [PATCH v7 11/11] lua/log: use log_cfg instead of ffi's instances

Oleg Babin olegrok at tarantool.org
Tue Jun 2 10:52:54 MSK 2020


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 <lvasiliev at tarantool.org>
> Signed-off-by: Cyrill Gorcunov <gorcunov at gmail.com>
> ---
>   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
> 


More information about the Tarantool-patches mailing list