Tarantool development patches archive
 help / color / mirror / Atom feed
From: Alexander Turenko via Tarantool-patches <tarantool-patches@dev.tarantool.org>
To: Cyrill Gorcunov <gorcunov@gmail.com>
Cc: Vladislav Shpilevoy <v.shpilevoy@tarantool.org>,
	tml <tarantool-patches@dev.tarantool.org>
Subject: Re: [Tarantool-patches] [PATCH] lua/log: accept symbolic logging levels
Date: Thu, 27 May 2021 12:04:31 +0300	[thread overview]
Message-ID: <20210527090431.kiki5jijygpfq7l5@tkn_work_nb> (raw)
In-Reply-To: <YK9P/KWvoBWj+jtw@grain>

On Thu, May 27, 2021 at 10:53:32AM +0300, Cyrill Gorcunov wrote:
> On Thu, May 27, 2021 at 01:04:54AM +0300, Alexander Turenko wrote:
> > Sorry for the late response.
> > 
> > Looks nice! LGTM.
> > 
> > If you'll have a free time, it would be good to add a simple test case:
> > just to automatically verify it for regressions in a future.
> > 
> 
> Thanks! I force pushed an update where a test added (we can extend
> it in future).

> +-- Test symbolic names for loglevels
> +_, err = pcall(log.cfg, {level='fatal'})
> +test:ok(err == nil and log.cfg.level == 0, 'both got fatal')

Now I noticed one difference from box.cfg() behaviour:

 | tarantool> box.cfg{log_level = 'verbose'}
 | tarantool> box.cfg.log_level
 | ---
 | - verbose
 | ...

 | tarantool> log = require('log')
 | tarantool> log.cfg{level = 'verbose'}
 | tarantool> log.cfg.level
 | ---
 | - 6
 | ...

AFAIU, box.cfg.foo generally returns the same that a user provides in
box.cfg({foo = <...>}), without normalization.

The only exception from this rule, known to me, is convertion from a
number to a string for box.cfg.listen:

 | tarantool> box.cfg{listen = 3301}
 | tarantool> box.cfg.listen
 | ---
 | - '3301'
 | ...

I don't know, to be honest, whether the general rule was part of design
or becomes so unintentionally. However, when we add listening on zero
port ([1]), we added a real port into box.info.listen and didn't perform
normalization in box.cfg.listen.

Not a blocker, IMHO, but it worth to think about. I'll add Vlad into the
discussion. Maybe he knows more than me.

[1]: https://github.com/tarantool/tarantool/issues/4620

WBR, Alexander Turenko.

  reply	other threads:[~2021-05-27  9:04 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-07 11:13 Cyrill Gorcunov via Tarantool-patches
2021-05-07 11:17 ` Cyrill Gorcunov via Tarantool-patches
2021-05-26 11:04 ` Serge Petrenko via Tarantool-patches
2021-05-26 22:04 ` Alexander Turenko via Tarantool-patches
2021-05-27  7:53   ` Cyrill Gorcunov via Tarantool-patches
2021-05-27  9:04     ` Alexander Turenko via Tarantool-patches [this message]
2021-05-27 10:17       ` Cyrill Gorcunov via Tarantool-patches
2021-06-01 12:25 ` Kirill Yukhin via Tarantool-patches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210527090431.kiki5jijygpfq7l5@tkn_work_nb \
    --to=tarantool-patches@dev.tarantool.org \
    --cc=alexander.turenko@tarantool.org \
    --cc=gorcunov@gmail.com \
    --cc=v.shpilevoy@tarantool.org \
    --subject='Re: [Tarantool-patches] [PATCH] lua/log: accept symbolic logging levels' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox