Tarantool development patches archive
 help / color / mirror / Atom feed
From: Cyrill Gorcunov <gorcunov@gmail.com>
To: tml <tarantool-patches@dev.tarantool.org>
Cc: yaroslav.dynnikov@gmail.com
Subject: [Tarantool-patches] [PATCH v3 3/3] test: app-tap/logger -- test json in boottime logger
Date: Thu,  2 Jul 2020 12:50:54 +0300	[thread overview]
Message-ID: <20200702095054.367131-4-gorcunov@gmail.com> (raw)
In-Reply-To: <20200702095054.367131-1-gorcunov@gmail.com>

Make sure we're allowed to setup json formatter before
box.cfg() call, ie that named boot-time logger.

Part-of #5121

Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
---
 test/app-tap/logger.test.lua | 19 +++++++++++++++----
 1 file changed, 15 insertions(+), 4 deletions(-)

diff --git a/test/app-tap/logger.test.lua b/test/app-tap/logger.test.lua
index ae4a3b99a..a448ba87a 100755
--- a/test/app-tap/logger.test.lua
+++ b/test/app-tap/logger.test.lua
@@ -1,13 +1,24 @@
 #!/usr/bin/env tarantool
 
 local test = require('tap').test('log')
-test:plan(62)
+test:plan(64)
 
--- gh-3946: Assertion failure when using log_format() before box.cfg()
+--
+-- gh-5121: Allow to use 'json' output before box.cfg()
+--
 local log = require('log')
-log.log_format('plain')
 _, err = pcall(log.log_format, 'json')
-test:ok(err:find("json can\'t be used") ~= nil)
+test:ok(err == nil)
+
+-- We're not allowed to use json with syslog though.
+_, err = pcall(log.cfg, {log='syslog:', format='json'})
+test:ok(tostring(err):find("can\'t be used with syslog logger") ~= nil)
+
+_, err = pcall(box.cfg, {log='syslog:', log_format='json'})
+test:ok(tostring(err):find("can\'t be used with syslog logger") ~= nil)
+
+-- switch back to plain to next tests
+log.log_format('plain')
 
 --
 -- gh-689: various settings change from box.cfg/log.cfg interfaces
-- 
2.26.2

  parent reply	other threads:[~2020-07-02  9:51 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-02  9:50 [Tarantool-patches] [PATCH v3 0/3] log: allow json formatter " Cyrill Gorcunov
2020-07-02  9:50 ` [Tarantool-patches] [PATCH v3 1/3] core/say: allow to use json in boot logger Cyrill Gorcunov
2020-07-02  9:50 ` [Tarantool-patches] [PATCH v3 2/3] lua/log: allow to use json formatter early Cyrill Gorcunov
2020-07-02 10:05   ` Oleg Babin
2020-07-02 10:18     ` Cyrill Gorcunov
2020-07-02 10:29       ` Oleg Babin
2020-07-02  9:50 ` Cyrill Gorcunov [this message]
2020-07-02 10:08 ` [Tarantool-patches] [PATCH v3 0/3] log: allow json formatter in boottime logger Oleg Babin
2020-07-02 10:46 ` Yaroslav Dynnikov

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=20200702095054.367131-4-gorcunov@gmail.com \
    --to=gorcunov@gmail.com \
    --cc=tarantool-patches@dev.tarantool.org \
    --cc=yaroslav.dynnikov@gmail.com \
    --subject='Re: [Tarantool-patches] [PATCH v3 3/3] test: app-tap/logger -- test json in boottime logger' \
    /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