[Tarantool-patches] [PATCH 1/2] cfg: provide types for logger options

Alexander Turenko alexander.turenko at tarantool.org
Thu Apr 15 09:04:11 MSK 2021


From: Cyrill Gorcunov <gorcunov at gmail.com>

This needed for fast type check when fetching
options from environment variable.

Part-of #5602

Signed-off-by: Cyrill Gorcunov <gorcunov at gmail.com>
---
 src/box/lua/load_cfg.lua | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/src/box/lua/load_cfg.lua b/src/box/lua/load_cfg.lua
index c444cc235..72e889071 100644
--- a/src/box/lua/load_cfg.lua
+++ b/src/box/lua/load_cfg.lua
@@ -119,6 +119,18 @@ local module_cfg = {
     log_format          = log.box_api,
 }
 
+-- cfg types for modules, probably better to
+-- provide some API with type enumeration or
+-- similar. Currently it has use for environment
+-- processing only.
+local module_cfg_type = {
+    -- logging
+    log                 = 'string',
+    log_nonblock        = 'boolean',
+    log_level           = 'number, string',
+    log_format          = 'string',
+}
+
 -- types of available options
 -- could be comma separated lua types or 'any' if any type is allowed
 local template_cfg = {
-- 
2.30.0



More information about the Tarantool-patches mailing list