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 896294696C1 for ; Tue, 2 Jun 2020 01:26:20 +0300 (MSK) Received: by mail-lj1-f195.google.com with SMTP id z18so10123523lji.12 for ; Mon, 01 Jun 2020 15:26:20 -0700 (PDT) From: Cyrill Gorcunov Date: Tue, 2 Jun 2020 01:25:02 +0300 Message-Id: <20200601222507.560415-7-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 06/11] lua/log: declare log as separate variable List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: tml We gonna hide some internal symbols in sake of communication with box module, thus lets make it clear. Part-of #689 Reviewed-by: Oleg Babin Reviewed-by: Leonid Vasiliev Signed-off-by: Cyrill Gorcunov --- src/lua/log.lua | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/src/lua/log.lua b/src/lua/log.lua index d5a99076d..746e0d82f 100644 --- a/src/lua/log.lua +++ b/src/lua/log.lua @@ -187,16 +187,20 @@ local compat_v16 = { end; } -return setmetatable({ - warn = say_closure(S_WARN); - info = say_closure(S_INFO); - verbose = say_closure(S_VERBOSE); - debug = say_closure(S_DEBUG); - error = say_closure(S_ERROR); - rotate = log_rotate; - pid = log_pid; - level = log_level; - log_format = log_format; -}, { +local log = { + warn = say_closure(S_WARN), + info = say_closure(S_INFO), + verbose = say_closure(S_VERBOSE), + debug = say_closure(S_DEBUG), + error = say_closure(S_ERROR), + rotate = log_rotate, + pid = log_pid, + level = log_level, + log_format = log_format, +} + +setmetatable(log, { __index = compat_v16; }) + +return log -- 2.26.2