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

Cyrill Gorcunov gorcunov at gmail.com
Wed Jun 3 01:18:16 MSK 2020


To reduce number of ffi calls.

Part-of #689

Suggested-by: Leonid Vasiliev <lvasiliev at tarantool.org>
Reviewed-by: Oleg Babin <olegrok 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 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



More information about the Tarantool-patches mailing list