DPDK patches and discussions
 help / color / mirror / Atom feed
From: David Marchand <david.marchand@redhat.com>
To: Bruce Richardson <bruce.richardson@intel.com>
Cc: dev@dpdk.org, "Morten Brørup" <mb@smartsharesystems.com>,
	"Tyler Retzlaff" <roretzla@linux.microsoft.com>
Subject: Re: [PATCH v7 2/3] log: separate logging functions out of EAL
Date: Wed, 9 Aug 2023 13:58:37 +0200	[thread overview]
Message-ID: <CAJFAV8yTxiRD7pEYfs5uNahquYqY=Bh-o225R8mXw7Syq2kbzw@mail.gmail.com> (raw)
In-Reply-To: <20230731153902.2350026-3-bruce.richardson@intel.com>

Some nits on the doc (that I can fix when applying if you are ok with them) :

On Mon, Jul 31, 2023 at 5:39 PM Bruce Richardson
<bruce.richardson@intel.com> wrote:
> diff --git a/doc/guides/prog_guide/env_abstraction_layer.rst b/doc/guides/prog_guide/env_abstraction_layer.rst
> index 93c8a031be..8033f6cebd 100644
> --- a/doc/guides/prog_guide/env_abstraction_layer.rst
> +++ b/doc/guides/prog_guide/env_abstraction_layer.rst
> @@ -443,9 +443,7 @@ Per-lcore variables are implemented using *Thread Local Storage* (TLS) to provid
>  Logs
>  ~~~~
>
> -A logging API is provided by EAL.
> -By default, in a Linux application, logs are sent to syslog and also to the console.
> -However, the log function can be overridden by the user to use a different logging mechanism.
> +While originally part of EAL, DPDK logging functionality is now provided by the :ref:`Log_Library`.

:doc:`log_lib`

>
>  Trace and Debug Functions
>  ^^^^^^^^^^^^^^^^^^^^^^^^^
> diff --git a/doc/guides/prog_guide/index.rst b/doc/guides/prog_guide/index.rst
> index d89cd3edb6..ac91060992 100644
> --- a/doc/guides/prog_guide/index.rst
> +++ b/doc/guides/prog_guide/index.rst
> @@ -12,6 +12,7 @@ Programmer's Guide
>      overview
>      source_org
>      env_abstraction_layer
> +    log_lib
>      service_cores
>      trace_lib
>      rcu_lib
> diff --git a/doc/guides/prog_guide/log_lib.rst b/doc/guides/prog_guide/log_lib.rst
> new file mode 100644
> index 0000000000..706ddcfef3
> --- /dev/null
> +++ b/doc/guides/prog_guide/log_lib.rst
> @@ -0,0 +1,115 @@
> +..  SPDX-License-Identifier: BSD-3-Clause
> +    Copyright(c) 2023 Intel Corporation.
> +
> +.. _log_library:

Since we can directly point at this part of the documentation via
:doc:`/path/to/log_lib`, no need for an anchor at the top of the file.


> +
> +Log Library
> +============

nit: too long by one =.

> +
> +The DPDK Log library provides the logging functionality for other DPDK libraries and drivers.
> +By default, in a Linux application, logs are sent to syslog and also to the console.
> +On FreeBSD and Windows applications, logs are sent only to the console.
> +However, the log function can be overridden by the user to use a different logging mechanism.
> +
> +Log Levels
> +-----------

Idem.

> +
> +Log messages from apps and libraries are reported with a given level of severity.
> +These levels, specified in ``rte_log.h`` are (from most to least important):
> +
> +#. Emergency
> +#. Alert
> +#. Critical
> +#. Error
> +#. Warning
> +#. Notice
> +#. Information
> +#. Debug
> +
> +At runtime, only messages of a configured level or above (i.e. of higher importance)
> +will be emitted by the application to the log output.
> +That level can be configured either by the application calling the relevant APIs from the logging library,
> +or by the user passing the ``--log-level`` parameter to the EAL via the application.
> +
> +Setting Global Log Level
> +~~~~~~~~~~~~~~~~~~~~~~~~~

Idem.

> +
> +To adjust the global log level for an application,
> +just pass a numeric level or a level name to the ``--log-level`` EAL parameter.
> +For example::
> +
> +       /path/to/app --log-level=error
> +
> +       /path/to/app --log-level=debug
> +
> +       /path/to/app --log-level=5   # warning
> +
> +Within an application, the log level can be similarly set using the ``rte_log_set_global_level`` API.
> +
> +Setting Log Level for a Component
> +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Idem.

> +
> +In some cases, for example, for debugging purposes,
> +it may be desirable to increase or decrease the log level for only a specific component, or set of components.
> +To facilitate this, the ``--log-level`` argument also accepts an, optionally wildcarded, component name,
> +along with the desired level for that component.
> +For example::
> +
> +       /path/to/app --log-level=lib.eal:crit
> +
> +       /path/to/app --log-level=lib.*:warning
> +
> +Within an application, the same result can be got using the ``rte_log_set_level_pattern()`` or ``rte_log_set_level_regex()`` APIs.
> +
> +Using Logging APIs to Generate Log Messages
> +--------------------------------------------

Idem.

> +
> +To output log messages, ``rte_log()`` API function should be used.
> +As well as the log message, ``rte_log()`` takes two additional parameters:
> +
> +* The log level
> +* The log component type
> +


-- 
David Marchand


  parent reply	other threads:[~2023-08-09 11:58 UTC|newest]

Thread overview: 58+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-29 15:18 [RFC PATCH 0/3] Split logging " Bruce Richardson
2022-08-29 15:18 ` [RFC PATCH 1/3] os: begin separating some OS compatibility from EAL Bruce Richardson
2022-08-29 18:57   ` Morten Brørup
2022-08-30  8:41     ` Bruce Richardson
2022-08-30  8:42   ` David Marchand
2022-08-30  9:59     ` Bruce Richardson
2022-08-29 15:19 ` [RFC PATCH 2/3] log: separate logging functions out of EAL Bruce Richardson
2022-08-29 15:19 ` [RFC PATCH 3/3] telemetry: use standard logging Bruce Richardson
2023-01-13 16:19 ` [RFC PATCH v2 0/3] Split logging functionality out of EAL Bruce Richardson
2023-01-13 16:19   ` [RFC PATCH v2 1/3] eal/windows: move fnmatch function to header file Bruce Richardson
2023-01-13 16:41     ` Morten Brørup
2023-01-13 17:01       ` Bruce Richardson
2023-01-13 17:31         ` Tyler Retzlaff
2023-01-13 17:37           ` Bruce Richardson
2023-01-13 16:20   ` [RFC PATCH v2 2/3] log: separate logging functions out of EAL Bruce Richardson
2023-01-13 16:20   ` [RFC PATCH v2 3/3] telemetry: use standard logging Bruce Richardson
2023-01-13 20:36 ` [PATCH v3 0/3] Split logging functionality out of EAL Bruce Richardson
2023-01-13 20:36   ` [PATCH v3 1/3] eal/windows: move fnmatch function to header file Bruce Richardson
2023-01-13 20:36   ` [PATCH v3 2/3] log: separate logging functions out of EAL Bruce Richardson
2023-01-13 20:36   ` [PATCH v3 3/3] telemetry: use standard logging Bruce Richardson
2023-01-20 18:21 ` [PATCH v4 0/3] Split logging functionality out of EAL Bruce Richardson
2023-01-20 18:21   ` [PATCH v4 1/3] eal/windows: move fnmatch function to header file Bruce Richardson
2023-01-20 18:21   ` [PATCH v4 2/3] log: separate logging functions out of EAL Bruce Richardson
2023-01-20 18:21   ` [PATCH v4 3/3] telemetry: use standard logging Bruce Richardson
2023-01-22 14:56   ` [PATCH v4 0/3] Split logging functionality out of EAL David Marchand
2023-01-23 14:24     ` Bruce Richardson
2023-01-23 14:31       ` David Marchand
2023-01-23 14:36         ` Bruce Richardson
2023-01-23 14:42           ` David Marchand
2023-05-18 12:49 ` [PATCH v5 " Bruce Richardson
2023-05-18 12:49   ` [PATCH v5 1/3] eal/windows: move fnmatch function to header file Bruce Richardson
2023-05-18 12:49   ` [PATCH v5 2/3] log: separate logging functions out of EAL Bruce Richardson
2023-05-18 12:49   ` [PATCH v5 3/3] telemetry: use standard logging Bruce Richardson
2023-07-31 10:17 ` [PATCH v6 0/3] Split logging functionality out of EAL Bruce Richardson
2023-07-31 10:17   ` [PATCH v6 1/3] eal/windows: move fnmatch function to header file Bruce Richardson
2023-07-31 10:17   ` [PATCH v6 2/3] log: separate logging functions out of EAL Bruce Richardson
2023-07-31 10:17   ` [PATCH v6 3/3] telemetry: use standard logging Bruce Richardson
2023-07-31 15:38 ` [PATCH v7 0/3] Split logging functionality out of EAL Bruce Richardson
2023-07-31 15:39   ` [PATCH v7 1/3] eal/windows: move fnmatch function to header file Bruce Richardson
2023-08-09 11:18     ` David Marchand
2023-08-09 12:35       ` Bruce Richardson
2023-07-31 15:39   ` [PATCH v7 2/3] log: separate logging functions out of EAL Bruce Richardson
2023-07-31 16:22     ` David Marchand
2023-07-31 16:29       ` Bruce Richardson
2023-08-09 10:00         ` Bruce Richardson
2023-08-09 11:58     ` David Marchand [this message]
2023-08-09 12:24     ` David Marchand
2023-08-09 12:32       ` Bruce Richardson
2023-07-31 15:39   ` [PATCH v7 3/3] telemetry: use standard logging Bruce Richardson
2023-08-09 13:35 ` [PATCH v8 0/3] Split logging functionality out of EAL Bruce Richardson
2023-08-09 13:35   ` [PATCH v8 1/3] eal/windows: move fnmatch function to header file Bruce Richardson
2023-08-09 13:35   ` [PATCH v8 2/3] log: separate logging functions out of EAL Bruce Richardson
2023-08-09 13:35   ` [PATCH v8 3/3] telemetry: use standard logging Bruce Richardson
2023-08-11 12:46   ` [PATCH v8 0/3] Split logging functionality out of EAL David Marchand
2023-08-11 12:59     ` Bruce Richardson
2023-09-01 11:25       ` Thomas Monjalon
2023-09-01 12:26         ` Morten Brørup
2023-10-23  7:37     ` David Marchand

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to='CAJFAV8yTxiRD7pEYfs5uNahquYqY=Bh-o225R8mXw7Syq2kbzw@mail.gmail.com' \
    --to=david.marchand@redhat.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=mb@smartsharesystems.com \
    --cc=roretzla@linux.microsoft.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).