Tarantool development patches archive
 help / color / mirror / Atom feed
* [tarantool-patches] [PATCH] log: add missing assert into log_set_format()
@ 2019-03-02 17:29 Roman Khabibov
  2019-03-05 14:21 ` Vladimir Davydov
  0 siblings, 1 reply; 7+ messages in thread
From: Roman Khabibov @ 2019-03-02 17:29 UTC (permalink / raw)
  To: tarantool-patches; +Cc: v.shpilevoy

Add missing condition for json format into assert in log_set_format() function.

Closes #3946
---

Branch: https://github.com/tarantool/tarantool/tree/romanhabibov/gh-3946-log-assert/test
Issue: https://github.com/tarantool/tarantool/issues/3946

 src/lib/core/say.c           | 3 ++-
 test/app-tap/logger.test.lua | 6 +++++-
 2 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/lib/core/say.c b/src/lib/core/say.c
index 50ee55692..758b1c234 100644
--- a/src/lib/core/say.c
+++ b/src/lib/core/say.c
@@ -170,7 +170,8 @@ log_set_level(struct log *log, enum say_level level)
 void
 log_set_format(struct log *log, log_format_func_t format_func)
 {
-	assert(format_func == say_format_plain ||
+	assert(format_func == say_format_json ||
+	       format_func == say_format_plain ||
 	       log->type == SAY_LOGGER_STDERR ||
 	       log->type == SAY_LOGGER_PIPE || log->type == SAY_LOGGER_FILE);
 
diff --git a/test/app-tap/logger.test.lua b/test/app-tap/logger.test.lua
index 0c11702c8..4e18d53e9 100755
--- a/test/app-tap/logger.test.lua
+++ b/test/app-tap/logger.test.lua
@@ -1,13 +1,17 @@
 #!/usr/bin/env tarantool
 
 local test = require('tap').test('log')
-test:plan(24)
+test:plan(25)
 
 --
 -- Check that Tarantool creates ADMIN session for #! script
 --
 local filename = "1.log"
 local message = "Hello, World!"
+
+jlog = require('log')
+test:ok(jlog.log_format("json") == nil, "no assertions")
+
 box.cfg{
     log=filename,
     memtx_memory=107374182,
-- 
2.17.2 (Apple Git-113)

^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2019-03-26 17:26 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-02 17:29 [tarantool-patches] [PATCH] log: add missing assert into log_set_format() Roman Khabibov
2019-03-05 14:21 ` Vladimir Davydov
2019-03-18 15:35   ` [tarantool-patches] " Roman Khabibov
2019-03-19  8:30     ` Vladimir Davydov
2019-03-25 12:43       ` [tarantool-patches] " Roman Khabibov
2019-03-25 13:03       ` Roman Khabibov
2019-03-26 17:26         ` Vladimir Davydov

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