From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-f194.google.com (mail-lj1-f194.google.com [209.85.208.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by dev.tarantool.org (Postfix) with ESMTPS id 1B47742EF5C for ; Thu, 2 Jul 2020 12:51:10 +0300 (MSK) Received: by mail-lj1-f194.google.com with SMTP id f5so15174071ljj.10 for ; Thu, 02 Jul 2020 02:51:10 -0700 (PDT) From: Cyrill Gorcunov Date: Thu, 2 Jul 2020 12:50:52 +0300 Message-Id: <20200702095054.367131-2-gorcunov@gmail.com> In-Reply-To: <20200702095054.367131-1-gorcunov@gmail.com> References: <20200702095054.367131-1-gorcunov@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH v3 1/3] core/say: allow to use json in boot logger List-Id: Tarantool development patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: tml Cc: yaroslav.dynnikov@gmail.com For some reason in commit 098324556 we've disabled to use json format in boot time logger. There is no reason to do so. Only syslog output format is predefined and must not be changed, in turn json format is just a decoration over output stream so we can use it whenever requested. Part-of #5121 Signed-off-by: Cyrill Gorcunov --- src/lib/core/say.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/lib/core/say.c b/src/lib/core/say.c index 791011e6f..b903cb03f 100644 --- a/src/lib/core/say.c +++ b/src/lib/core/say.c @@ -206,17 +206,14 @@ say_set_log_format(enum say_format format) { log_format_func_t format_func; /* - * When logger type is SAY_LOGGER_BOOT it simply prints - * every message to stdout intact and can't be formatted. * SAY_LOGGER_SYSLOG type uses the well-documented and * *recommended* format described in the RFC below: * https://tools.ietf.org/html/rfc3164#section-4.1 * Thereby format can't be changed for this type either. */ - bool unchangeable = log_default->type == SAY_LOGGER_BOOT || - log_default->type == SAY_LOGGER_SYSLOG; - if (unchangeable) + if (log_default->type == SAY_LOGGER_SYSLOG) return; + switch (format) { case SF_JSON: format_func = say_format_json; -- 2.26.2