From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 09EA645CB1; Fri, 8 Nov 2024 09:48:53 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id E7CF942FF9; Fri, 8 Nov 2024 09:48:52 +0100 (CET) Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mails.dpdk.org (Postfix) with ESMTP id 456FC42FAF for ; Fri, 8 Nov 2024 09:48:51 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1731055730; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=sdawE0ZKtH5+thRNqdo4kWhpI7kL8vzVjtLyqaHetRU=; b=McgUK3V/Ne6sPyocyYoaFQSoKkPZSNuxrIEC/PYRkiEMTxlwjS0SnQ1QUYBay1YQAUmClK Mkn8o0ynbwBO+EP8vNebbQr6FS0EG3/+QVV/rWhDL+A//GJwMGAj5vVjkFKxbcdvPHmYUm fM/8zn4SPNr28Wr8Xke5kVN2GnbCMqU= Received: from mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (ec2-54-186-198-63.us-west-2.compute.amazonaws.com [54.186.198.63]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-354-NaPj2K4dO4imwFU0cB0i6w-1; Fri, 08 Nov 2024 03:48:09 -0500 X-MC-Unique: NaPj2K4dO4imwFU0cB0i6w-1 X-Mimecast-MFC-AGG-ID: NaPj2K4dO4imwFU0cB0i6w Received: from mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com [10.30.177.15]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mx-prod-mc-04.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTPS id 798961955D55 for ; Fri, 8 Nov 2024 08:48:08 +0000 (UTC) Received: from dmarchan.redhat.com (unknown [10.45.224.57]) by mx-prod-int-02.mail-002.prod.us-west-2.aws.redhat.com (Postfix) with ESMTP id 926B21955F43 for ; Fri, 8 Nov 2024 08:48:07 +0000 (UTC) From: David Marchand To: dev@dpdk.org Subject: [PATCH v31 00/12] Log library enhancements Date: Fri, 8 Nov 2024 09:47:49 +0100 Message-ID: <20241108084802.2942435-1-david.marchand@redhat.com> In-Reply-To: <20200814173441.23086-1-stephen@networkplumber.org> References: <20200814173441.23086-1-stephen@networkplumber.org> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 3.0 on 10.30.177.15 X-Mimecast-Spam-Score: 0 X-Mimecast-MFC-PROC-ID: y36a0vlhqiD4wVQPLlZgWYTxyOdFb710Ea5a8rOq6Ns_1731055688 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Improvements and unification of logging library. This version works on all platforms: Linux, Windows and FreeBSD. This is update to rework patch set. It adds several new features to the console log output. * Putting a timestamp on console output which is useful for analyzing performance of startup codes. Timestamp is optional and must be enabled on command line. * Displaying console output with colors. It uses the standard conventions used by many other Linux commands for colorized display. The default is to enable color if the console output is going to a terminal. But it can be always on or disabled by command line flag. This default was chosen based on what dmesg(1) command does. Color is used by many tools (vi, iproute2, git) because it is helpful; DPDK drivers and libraries print lots of not very useful messages. And having error messages highlighted in bold face helps. This might also get users to pay more attention to error messages. Many bug reports have earlier messages that are lost because there are so many info messages. * Add support for automatic detection of systemd journal protocol. If running as systemd service will get enhanced logging. * Use of syslog is optional and the meaning of the --syslog flag has changed. The default is *not* to use unless requested. Add Stephen as maintainer for log because by now have added more than previous authors. Resending for CI: Changes since v31: - rebased, - fixed build with MSVC: escape character was restored to \033 (used until v25) instead of \e, Changes since v30: - added a little helper that identifies log options (this fixed a little bug with the color option being parsed twice) and renamed eal_log_level_parse() as eal_parse_log_options(), - adjusted log level to ALERT for EAL error on Windows, - split RN updates in relevant patches and fixed style, - fixed --syslog usage string, - split and squashed Windows shim update in relevant patches, - fixed typos, - cleaned duplicate inclusion of headers, - moved syslog facility code update in relevant patch, - removed dead reference to eal_log_set_default, -- David Marchand David Marchand (1): eal: introduce log options parser Stephen Hemminger (11): eal/windows: align getopt to FreeBSD eal: factorize parser for log level eal: do not log init failure twice eal: improve exit output log log: rework syslog handling eal: initialize log before everything else log: add hook for printing log messages log: add timestamp option log: support systemd journal log: colorize log output maintainers: update for log library MAINTAINERS | 1 + app/test/test_eal_flags.c | 64 ++++- .../freebsd_gsg/freebsd_eal_parameters.rst | 27 ++ .../prog_guide/env_abstraction_layer.rst | 6 +- doc/guides/prog_guide/log_lib.rst | 58 ++++- doc/guides/rel_notes/release_24_11.rst | 16 ++ lib/eal/common/eal_common_debug.c | 6 +- lib/eal/common/eal_common_options.c | 132 ++++++---- lib/eal/common/eal_internal_cfg.h | 1 - lib/eal/common/eal_options.h | 6 + lib/eal/freebsd/eal.c | 63 +---- lib/eal/linux/eal.c | 66 +---- lib/eal/windows/eal.c | 51 +--- lib/eal/windows/getopt.c | 23 +- lib/eal/windows/include/getopt.h | 8 +- lib/eal/windows/include/rte_os_shim.h | 12 + lib/log/log.c | 82 ++++-- lib/log/log_color.c | 214 ++++++++++++++++ lib/log/log_freebsd.c | 12 - lib/log/log_internal.h | 28 +- lib/log/log_journal.c | 153 +++++++++++ lib/log/log_linux.c | 61 ----- lib/log/log_private.h | 57 +++++ lib/log/log_syslog.c | 108 ++++++++ lib/log/log_timestamp.c | 240 ++++++++++++++++++ lib/log/log_windows.c | 18 -- lib/log/meson.build | 12 +- lib/log/version.map | 5 +- 28 files changed, 1171 insertions(+), 359 deletions(-) create mode 100644 lib/log/log_color.c delete mode 100644 lib/log/log_freebsd.c create mode 100644 lib/log/log_journal.c delete mode 100644 lib/log/log_linux.c create mode 100644 lib/log/log_private.h create mode 100644 lib/log/log_syslog.c create mode 100644 lib/log/log_timestamp.c delete mode 100644 lib/log/log_windows.c -- 2.47.0