[Tarantool-patches] [PATCH v4 7/8] lua/log: allow to configure logging without a box
Leonid Vasiliev
lvasiliev at tarantool.org
Fri May 29 14:08:41 MSK 2020
On 29.05.2020 13:38, Cyrill Gorcunov wrote:
> On Fri, May 29, 2020 at 01:22:51PM +0300, Leonid Vasiliev wrote:
>> I don't object, but why it can't be implemented by simple callback (we have
>> only one recipient), which will be set in load_cfg.lua and called in case of
>> updating.
>
> Is not it the same as we do now?
>
> box.load_cfg
> apply_default_modules_cfg
> log.box_api.cfg_apply_default(cfg)
>
> box.reload_cfg
> update_modules_cfg
> log.box_api.cfg_update
>
> The thing is that if we create some kind of geneal callbacks
> we need to provide that named "stages" and hook-in modules
> when they're loaded in.
>
> If you have some other code in mind please show it as a pseudocode
>
I mean something like that:
in load_cfg.lua:
local function on_log_module_update()
-- set updated values to box.cfg
....
end
local function load_cfg()
....
log.cfg.on_log_module_update = on_log_module_update
...
end
in log.lua:
local function load_cfg()
...
-- Check is callback set.
if log_cfg['on_log_module_update'] then
log_cfg.on_log_module_update()
end
...
end
More information about the Tarantool-patches
mailing list