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 60ACC45BF5; Sun, 27 Oct 2024 18:26:28 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 375D24026B; Sun, 27 Oct 2024 18:26:28 +0100 (CET) Received: from mail-pl1-f181.google.com (mail-pl1-f181.google.com [209.85.214.181]) by mails.dpdk.org (Postfix) with ESMTP id 96A9640151 for ; Sun, 27 Oct 2024 18:26:26 +0100 (CET) Received: by mail-pl1-f181.google.com with SMTP id d9443c01a7336-20ca7fc4484so23949085ad.3 for ; Sun, 27 Oct 2024 10:26:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1730049985; x=1730654785; 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=t/NBvTuvr4tZcu7qc42n74R6HE4fdGJUKW7sTQuKgsQ=; b=D8/xok+zzgDEsFO3bYUcuo5EHtjGrZIjuJ3rhTK7XxgWiu1gDagEYtNTVxYSPNTBgX xqCKBQ2g9RIpHV6/2y5cZndMwqq+pyJGmESx1KC3fK81BfRdKrkkFKI75amHE8p51hfB 50YHO3nYH8ILX21tvyDMyp6tssHPJeN4bfv/eKJH9Gy+JpztWyu/XDOOgF92a4FOATwU 50CVDqZTO5ZbUIr2xd+mwL06g3SRpqqE+CmJvAjqWJaEpD7PD+fdz06dQ+odoKT23l3l PHNkTy3FT7bDACNstPeLXSxknStE47cThaUSGqi7x66Z3Bcuib1yD1FGJNF3osAVeoV8 YFag== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1730049985; x=1730654785; 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=t/NBvTuvr4tZcu7qc42n74R6HE4fdGJUKW7sTQuKgsQ=; b=BpnXMrB89GcrGUiZ6X2DhV9b8Tfd3GcwQMU0WGaQD/D/boR3wGs/m3mUK2YSFSaNda wu4HMAyyc/IzidmMesgVWg5ty9D7W9Vb8XG8UvV+EAw+F37RXfbUq4lMe6xDVgMMFcnb nSbDCiBNgskP4lJwSOV5930FV+W2MkNDL2B+062W0M5Q9biTTOGed9mOZY9EHwIRDZvT Ygk+XR5RRiawrAWkYGEWrXrDJ1/pEMFRyG5m7D8Fb3T3ZNzIjAuR0VHAGR0xEeJmwEKH X7mOHB7oEwcOVxm88YcjG7lmq5VjUH3ADj1jiCRrAN679NrYViZeBiYwXLLWbg9oLnmK JO8g== X-Gm-Message-State: AOJu0Yw2APWd5iWDOjR3jZafdUO9w9CpICIRCLBpNCJznJQyd5i4ucOQ 8TxPGRsWKW6W5o5VW2N/Y8FmlZ5utGfTKBNXYMQFvxOWDGOyVleUlqnW8sBhqPxd87MNLblD0Ig 9Uy2pMQ== X-Google-Smtp-Source: AGHT+IGmxBtlNY19nhP6Pwfdb1B96DEVOLDsFzM/6FHGiqkNCMUYmixolJObi4o23RXXksbCxuN2pA== X-Received: by 2002:a17:902:cf43:b0:20f:c094:b80f with SMTP id d9443c01a7336-210c6c6b776mr56729375ad.49.1730049985554; Sun, 27 Oct 2024 10:26:25 -0700 (PDT) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-210bbf71d50sm37754465ad.72.2024.10.27.10.26.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 27 Oct 2024 10:26:25 -0700 (PDT) From: Stephen Hemminger To: dev@dpdk.org Cc: Stephen Hemminger Subject: [PATCH v30 00/13] Log library enhancements Date: Sun, 27 Oct 2024 10:24:30 -0700 Message-ID: <20241027172616.176175-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. v30 - add isatty() to windows os shim fix wording in release note etc. Stephen Hemminger (13): 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: rework syslog handling eal: initialize log before everything else log: add hook for printing log messages 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 ++++- .../freebsd_gsg/freebsd_eal_parameters.rst | 27 ++ .../prog_guide/env_abstraction_layer.rst | 6 +- doc/guides/prog_guide/log_lib.rst | 60 ++++- doc/guides/rel_notes/release_24_11.rst | 20 ++ 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 | 65 ++--- 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 | 12 + lib/log/log.c | 83 ++++-- lib/log/log_color.c | 214 ++++++++++++++++ lib/log/log_freebsd.c | 12 - lib/log/log_internal.h | 22 +- lib/log/log_journal.c | 152 +++++++++++ lib/log/log_linux.c | 61 ----- lib/log/log_private.h | 53 ++++ 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, 1168 insertions(+), 352 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