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 7807545BB9; Thu, 24 Oct 2024 05:20:39 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 5EF0943352; Thu, 24 Oct 2024 05:20:39 +0200 (CEST) Received: from mail-pf1-f172.google.com (mail-pf1-f172.google.com [209.85.210.172]) by mails.dpdk.org (Postfix) with ESMTP id 96DDC402CF for ; Thu, 24 Oct 2024 05:20:37 +0200 (CEST) Received: by mail-pf1-f172.google.com with SMTP id d2e1a72fcca58-71f5208217dso289758b3a.2 for ; Wed, 23 Oct 2024 20:20:37 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1729740036; x=1730344836; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=RDVwtRrG8tJeB8dg/0jlX07+1tpHl84VdPZJKmOeL7s=; b=UPG5a6/A0Z4iuDfmkg3Zhb+g/q3mh0hj5Z896JbREC0Aa4TkT4OH0DOzmfK6s/uVsE 0BPqNZVwUvOSLWC+nYfDN/bjwB8AK6s3CX0lwO59AcPtCihkLb35YlMDjtRFJQrHbsJE LOaPUgjhhI1J2FrtC9UZSYojyZK5NwDpySpPVlniP/9CutCFs2gTFJ+/n65uqlpg2skT 15AdN4vCZsFuY/5kqmd+zTjhjBzci2yAR13aawjbtbk+zXCXK1+sFSx4PPZ31SlYjFC0 p/0RNWE7DQTSN4Yd6ShkuGn63cmPlSEvdoHRnm7piJuxVod17hMRD3rdlUrY/Q1qUFME wBsQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1729740036; x=1730344836; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=RDVwtRrG8tJeB8dg/0jlX07+1tpHl84VdPZJKmOeL7s=; b=O8cNn61W7d2eD4pE+zhWZ27uGO8LGpKcyUsZ3SEDHJZazb8MwnzZ//lIz6HimI8Vab xs4SaR5SZzgHbic8PqM1SGF/4+BD4U08BU7T36Ro4Bb23RBksZiM1lTTqZQ0t5DDMtj8 ayGsQEarbENKuvZ6VbyS3Ghn8uayPxDCRehI/csdAb/C2uKIjmJx1VfzS8v/DS9AnEGH /9MTvU3mJtXl/KxKm1xCI2z4legbLqrCrzz5DVH9aID/Dc8jWOj1T8pHNIsLu9rIT/5B /rgrKHMYu2DwnK6IbTjJutelzUaHYlYRxhAowQkK15wteua0ZzhGOk1qiVsOAdEuop7H e5zw== X-Gm-Message-State: AOJu0YxLh8jDlgjNjQJ9aN5mPuSyByCTawisL/FpIWl9dOno14Cf5zup niIIc8gRWZAQ3P9qjgGBYEHGr8A9cooCc9xrQD17CM4fNIuFpsgOvKWDXc2mH5nUY+gGJk1aqjl x X-Google-Smtp-Source: AGHT+IGv6X0uIwMJP+8tQ3jz8IAmteWF1H6Ws/wWXk7CSXX4Eb425ZjhYMgwP0hVJ25FX7BuEFlMDQ== X-Received: by 2002:a05:6a00:2da4:b0:71e:55e2:2c54 with SMTP id d2e1a72fcca58-72045e4b601mr665767b3a.12.1729740036376; Wed, 23 Oct 2024 20:20:36 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-71ec1324d41sm6999533b3a.57.2024.10.23.20.20.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 23 Oct 2024 20:20:36 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH v27 00/14] Log subsystem changes Date: Wed, 23 Oct 2024 20:18:38 -0700 Message-ID: <20241024032026.415122-1-stephen@networkplumber.org> X-Mailer: git-send-email 2.45.2 In-Reply-To: <20200814173441.23086-1-stephen@networkplumber.org> References: <20200814173441.23086-1-stephen@networkplumber.org> MIME-Version: 1.0 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 myself as maintainer for log because by now have added more than previous authors. v27 - review feedback - consolidate and simplify - keep the meaning of --syslog=facility the same as before. v26 - rebase and change release note - by default, do not disable color - support dark mode with colors - when using color format message to string then print to avoid getting multiple threads intermixing on output. Stephen Hemminger (14): maintainers: add for log library windows: make getopt functions have const properties windows: update os shim eal: make eal_log_level_parse common eal: do not duplicate rte_init_alert() messages eal: change rte_exit() output to match rte_log() log: move handling of syslog facility out of eal eal: initialize log before everything else log: add hook for printing log messages log: modify syslog handling log: add timestamp option log: add support for systemd journal log: colorize log output doc: add release note about log library MAINTAINERS | 1 + app/test/test_eal_flags.c | 66 ++++- doc/guides/linux_gsg/linux_eal_parameters.rst | 27 -- doc/guides/prog_guide/log_lib.rst | 57 +++- doc/guides/rel_notes/release_24_11.rst | 19 ++ lib/eal/common/eal_common_debug.c | 6 +- lib/eal/common/eal_common_options.c | 122 +++++---- lib/eal/common/eal_internal_cfg.h | 1 - lib/eal/common/eal_options.h | 5 + lib/eal/freebsd/eal.c | 64 +---- lib/eal/linux/eal.c | 68 +---- lib/eal/windows/eal.c | 50 +--- lib/eal/windows/getopt.c | 23 +- lib/eal/windows/include/getopt.h | 8 +- lib/eal/windows/include/rte_os_shim.h | 10 + lib/log/log.c | 76 ++++-- lib/log/log_color.c | 216 +++++++++++++++ lib/log/log_freebsd.c | 12 - lib/log/log_internal.h | 28 +- lib/log/log_journal.c | 154 +++++++++++ lib/log/log_linux.c | 61 ----- lib/log/log_private.h | 36 +++ lib/log/log_syslog.c | 106 ++++++++ lib/log/log_timestamp.c | 245 ++++++++++++++++++ lib/log/log_windows.c | 18 -- lib/log/meson.build | 12 +- lib/log/version.map | 5 +- 27 files changed, 1114 insertions(+), 382 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.45.2