[Tarantool-patches] [PATCH v8 06/12] lua/log: declare log as separate variable
Cyrill Gorcunov
gorcunov at gmail.com
Wed Jun 3 01:18:11 MSK 2020
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 <olegrok at tarantool.org>
Reviewed-by: Leonid Vasiliev <lvasiliev at tarantool.org>
Signed-off-by: Cyrill Gorcunov <gorcunov at gmail.com>
---
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
More information about the Tarantool-patches
mailing list