[Tarantool-patches] [PATCH v4 4/8] lua/log: do not allow to set json for boot logger

Cyrill Gorcunov gorcunov at gmail.com
Thu May 28 14:59:27 MSK 2020


On Thu, May 28, 2020 at 02:49:04PM +0300, lvasiliev wrote:
> > diff --git a/src/lua/log.lua b/src/lua/log.lua
> > index d1d712cab..2491501f7 100644
> > --- a/src/lua/log.lua
> > +++ b/src/lua/log.lua
> > @@ -160,8 +160,11 @@ local function log_format(name)
> >       end
> >       if fmt_str2num[name] == ffi.C.SF_JSON then
> > -        if ffi.C.log_type() == ffi.C.SAY_LOGGER_SYSLOG then
> > -            error("log_format: 'json' can't be used with syslog logger")
> > +        if ffi.C.log_type() == ffi.C.SAY_LOGGER_SYSLOG or
> > +            ffi.C.log_type() == ffi.C.SAY_LOGGER_BOOT then
> > +            local m = "log_format: %s can't be used with " ..
> > +                    "syslog or boot-time logger" > +            error(m:format(fmt_num2str[ffi.C.SF_JSON]))
> Why do you use the format if the message is always the same?

To eliminate opencoded 'json' constant.


More information about the Tarantool-patches mailing list