From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lj1-f193.google.com (mail-lj1-f193.google.com [209.85.208.193]) (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 817EA42EF5C for ; Tue, 30 Jun 2020 19:02:25 +0300 (MSK) Received: by mail-lj1-f193.google.com with SMTP id h22so16061141lji.9 for ; Tue, 30 Jun 2020 09:02:25 -0700 (PDT) From: Cyrill Gorcunov Date: Tue, 30 Jun 2020 19:02:07 +0300 Message-Id: <20200630160209.279470-2-gorcunov@gmail.com> In-Reply-To: <20200630160209.279470-1-gorcunov@gmail.com> References: <20200630160209.279470-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 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