From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp45.i.mail.ru (smtp45.i.mail.ru [94.100.177.105]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 26280469710 for ; Fri, 29 May 2020 14:08:43 +0300 (MSK) References: <20200528100738.221911-1-gorcunov@gmail.com> <20200528100738.221911-8-gorcunov@gmail.com> <19d91eba-a988-0ee8-6c1b-1b83dca9fce8@tarantool.org> <51ab9c83-4392-b5bd-49ac-652b1892afa0@tarantool.org> <68d0aeab-2db7-b552-ec0d-4bc64de792e1@tarantool.org> <20200529094944.GH215590@grain> <8ed37f9d-8a13-fdec-296f-78b137ec774e@tarantool.org> <20200529103819.GJ215590@grain> From: Leonid Vasiliev Message-ID: Date: Fri, 29 May 2020 14:08:41 +0300 MIME-Version: 1.0 In-Reply-To: <20200529103819.GJ215590@grain> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Subject: Re: [Tarantool-patches] [PATCH v4 7/8] lua/log: allow to configure logging without a box List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Cyrill Gorcunov Cc: tml 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