From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-f195.google.com (mail-lj1-f195.google.com [209.85.208.195]) (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 1DA0840F3AE for ; Mon, 29 Jun 2020 14:23:39 +0300 (MSK) Received: by mail-lj1-f195.google.com with SMTP id s9so17540516ljm.11 for ; Mon, 29 Jun 2020 04:23:39 -0700 (PDT) From: Cyrill Gorcunov Date: Mon, 29 Jun 2020 14:23:17 +0300 Message-Id: <20200629112319.154909-2-gorcunov@gmail.com> In-Reply-To: <20200629112319.154909-1-gorcunov@gmail.com> References: <20200629112319.154909-1-gorcunov@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Tarantool-patches] [PATCH 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 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