lua/log: add ability to configure logging early
In the patch we introduce an ability to configure logging
engine early without calling box.cfg{} at all. For this sake
we have to modify the load_cfg.lua (main cfg loader) together
with log.lua built in module.
In particular the configuration entries which are supposed to
be handled by modules are grouped in module_cfg table, where we
list box.cfg{} keys and methods to fetch/set the values. Same time
the template_cfg{} starts to carry 'module' keyword telling
prepare_cfg routine to use modules.
@TarantoolBot documnent
Title: Module log
To configure log module eary without initializing box module
at all call the `log.cfg({})` method, where the following
arguments are acceptable:
- `log` to specify file, pipe or syslog (same as
`box.cfg{log}` option); the default value is nil
and stderr is used;
- `level` to specify logging level; can be numbers (1-7) or
strings (fatal,syserror,error,crit,warn,info,verbose,debug);
the default value is 5 (i.e. 'info');
While for symbolic representations of levels we allow only
predefined keywords to be used, to keep backward compatibility
the numbers can be any;
- `format` to specify output encoding ('plain' or 'json');
the default value is 'plain';
- `nonblock` to open logging output in nonblocking mode
(`true` or `false`); the default value is `false`.
Fixes #689
Signed-off-by:
Cyrill Gorcunov <gorcunov@gmail.com>
Loading
Please register or sign in to comment