From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp36.i.mail.ru (smtp36.i.mail.ru [94.100.177.96]) (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 DF94C469711 for ; Mon, 8 Jun 2020 18:31:21 +0300 (MSK) From: Oleg Babin References: <20200608104450.157253-1-gorcunov@gmail.com> <20200608104450.157253-4-gorcunov@gmail.com> Message-ID: <9e807a5c-1e86-7ece-9397-66f761d70cc2@tarantool.org> Date: Mon, 8 Jun 2020 18:31:18 +0300 MIME-Version: 1.0 In-Reply-To: <20200608104450.157253-4-gorcunov@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Subject: Re: [Tarantool-patches] [PATCH 3/3] test: app-tap/logger -- test symbolic loglevels List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Cyrill Gorcunov , tml Thanks for your patch. LGTM. On 08/06/2020 13:44, Cyrill Gorcunov wrote: > Part-of #689 > > Signed-off-by: Cyrill Gorcunov > --- > test/app-tap/logger.test.lua | 26 +++++++++++++++++++++++++- > 1 file changed, 25 insertions(+), 1 deletion(-) > > diff --git a/test/app-tap/logger.test.lua b/test/app-tap/logger.test.lua > index c2f0ab5c0..ae4a3b99a 100755 > --- a/test/app-tap/logger.test.lua > +++ b/test/app-tap/logger.test.lua > @@ -1,7 +1,7 @@ > #!/usr/bin/env tarantool > > local test = require('tap').test('log') > -test:plan(54) > +test:plan(62) > > -- gh-3946: Assertion failure when using log_format() before box.cfg() > local log = require('log') > @@ -70,6 +70,30 @@ test:ok(box.cfg.log == filename, "filename match") > test:ok(box.cfg.log_level == 6, "loglevel match") > verify_keys("box.cfg") > > +-- Test symbolic names for loglevels > +log.cfg({level='fatal'}) > +test:ok(log.cfg.level == 0 and box.cfg.log_level == 0, 'both got fatal') > +log.cfg({level='syserror'}) > +test:ok(log.cfg.level == 1 and box.cfg.log_level == 1, 'both got syserror') > +log.cfg({level='error'}) > +test:ok(log.cfg.level == 2 and box.cfg.log_level == 2, 'both got error') > +log.cfg({level='crit'}) > +test:ok(log.cfg.level == 3 and box.cfg.log_level == 3, 'both got crit') > +log.cfg({level='warn'}) > +test:ok(log.cfg.level == 4 and box.cfg.log_level == 4, 'both got warn') > +log.cfg({level='info'}) > +test:ok(log.cfg.level == 5 and box.cfg.log_level == 5, 'both got info') > +log.cfg({level='verbose'}) > +test:ok(log.cfg.level == 6 and box.cfg.log_level == 6, 'both got verbose') > +log.cfg({level='debug'}) > +test:ok(log.cfg.level == 7 and box.cfg.log_level == 7, 'both got debug') > + > +box.cfg{ > + log = filename, > + log_level = 6, > + memtx_memory = 107374182, > +} > + > -- Now try to change a static field. > _, err = pcall(box.cfg, {log_level = 5, log = "2.txt"}) > test:ok(tostring(err):find("can\'t be set dynamically") ~= nil) >