public inbox for docs@lists.yoctoproject.org
 help / color / mirror / Atom feed
* [PATCH 1/2] bitbake/doc/logging: small clean-up and name environment
@ 2025-01-02 14:14 Jörg Sommer
  2025-01-02 14:14 ` [PATCH 2/2] bitbake/doc/logging: convert warn.json to YAML Jörg Sommer
  2025-01-02 14:31 ` [docs] [PATCH 1/2] bitbake/doc/logging: small clean-up and name environment Antonin Godard
  0 siblings, 2 replies; 3+ messages in thread
From: Jörg Sommer @ 2025-01-02 14:14 UTC (permalink / raw)
  To: docs, joerg.sommer; +Cc: Jörg Sommer

From: Jörg Sommer <joerg.sommer@navimatix.de>

The variable *BB_LOGCONFIG* is part of *BB_ENV_PASSTHROUGH_ADDITIONS* in
/scripts/oe-buildenv-internal and can therefore be passed as environment
variable.

Signed-off-by: Jörg Sommer <joerg.sommer@navimatix.de>
---
 .../bitbake-user-manual-execution.rst                 | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/bitbake/doc/bitbake-user-manual/bitbake-user-manual-execution.rst b/bitbake/doc/bitbake-user-manual/bitbake-user-manual-execution.rst
index d58fbb32ea..a1267400ab 100644
--- a/bitbake/doc/bitbake-user-manual/bitbake-user-manual-execution.rst
+++ b/bitbake/doc/bitbake-user-manual/bitbake-user-manual-execution.rst
@@ -671,7 +671,7 @@ logging configuration is merged using the following rules:
 
 -  Any keys defined in the ``handlers``, ``formatters``, or ``filters``,
    will be merged into the same section in the default configuration,
-   with the user specified keys taking replacing a default one if there
+   with the user specified keys replacing a default one if there
    is a conflict. In practice, this means that if both the default
    configuration and user configuration specify a handler named
    ``myhandler``, the user defined one will replace the default. To
@@ -707,9 +707,9 @@ or higher priority to a file called ``hashequiv.log``::
            }
        },
        "formatters": {
-               "logfileFormatter": {
-                   "format": "%(name)s: %(levelname)s: %(message)s"
-               }
+           "logfileFormatter": {
+               "format": "%(name)s: %(levelname)s: %(message)s"
+           }
        },
        "loggers": {
            "BitBake.SigGen.HashEquiv": {
@@ -723,7 +723,8 @@ or higher priority to a file called ``hashequiv.log``::
        }
    }
 
-Then set the :term:`BB_LOGCONFIG` variable in ``conf/local.conf``::
+Then set the :term:`BB_LOGCONFIG` variable in the process environment when
+calling bitbake, or set it in ``conf/local.conf``::
 
    BB_LOGCONFIG = "hashequiv.json"
 
-- 
2.45.2



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 2/2] bitbake/doc/logging: convert warn.json to YAML
  2025-01-02 14:14 [PATCH 1/2] bitbake/doc/logging: small clean-up and name environment Jörg Sommer
@ 2025-01-02 14:14 ` Jörg Sommer
  2025-01-02 14:31 ` [docs] [PATCH 1/2] bitbake/doc/logging: small clean-up and name environment Antonin Godard
  1 sibling, 0 replies; 3+ messages in thread
From: Jörg Sommer @ 2025-01-02 14:14 UTC (permalink / raw)
  To: docs, joerg.sommer; +Cc: Jörg Sommer

From: Jörg Sommer <joerg.sommer@navimatix.de>

To give an example how the YAML format can be used, the example of the
warnings logger should be converted to YAML.

Signed-off-by: Jörg Sommer <joerg.sommer@navimatix.de>
---
 .../bitbake-user-manual-execution.rst         | 42 ++++++++-----------
 1 file changed, 18 insertions(+), 24 deletions(-)


Is the @ in front of disable_existing_loggers correct? In
https://docs.python.org/3/library/logging.config.html#dictionary-schema-details
it's not given. Or can we remove the whole line? At me it works.

diff --git a/bitbake/doc/bitbake-user-manual/bitbake-user-manual-execution.rst b/bitbake/doc/bitbake-user-manual/bitbake-user-manual-execution.rst
index a1267400ab..7335359918 100644
--- a/bitbake/doc/bitbake-user-manual/bitbake-user-manual-execution.rst
+++ b/bitbake/doc/bitbake-user-manual/bitbake-user-manual-execution.rst
@@ -728,35 +728,29 @@ calling bitbake, or set it in ``conf/local.conf``::
 
    BB_LOGCONFIG = "hashequiv.json"
 
-Another example is this ``warn.json`` file to log all ``WARNING`` and
+Another example is this ``warn.yaml`` file to log all ``WARNING`` and
 higher priority messages to a ``warn.log`` file::
 
-  {
-      "version": 1,
-      "formatters": {
-          "warnlogFormatter": {
-              "()": "bb.msg.BBLogFormatter",
-              "format": "%(levelname)s: %(message)s"
-          }
-      },
+  version: 1
 
-      "handlers": {
-          "warnlog": {
-              "class": "logging.FileHandler",
-              "formatter": "warnlogFormatter",
-              "level": "WARNING",
-              "filename": "warn.log"
-          }
-      },
+  '@disable_existing_loggers': false
 
-      "loggers": {
-          "BitBake": {
-              "handlers": ["warnlog"]
-          }
-      },
+  formatters:
+    warnlogFormatter:
+      '()': bb.msg.BBLogFormatter
+      format: '%(levelname)s: %(message)s'
 
-      "@disable_existing_loggers": false
-  }
+  handlers:
+    warnlog:
+      class: logging.FileHandler
+      formatter: warnlogFormatter
+      level: WARNING
+      filename: warn.log
+
+  loggers:
+    BitBake:
+      handlers:
+        - warnlog
 
 Note that BitBake's helper classes for structured logging are implemented in
 ``lib/bb/msg.py``.
-- 
2.45.2



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [docs] [PATCH 1/2] bitbake/doc/logging: small clean-up and name environment
  2025-01-02 14:14 [PATCH 1/2] bitbake/doc/logging: small clean-up and name environment Jörg Sommer
  2025-01-02 14:14 ` [PATCH 2/2] bitbake/doc/logging: convert warn.json to YAML Jörg Sommer
@ 2025-01-02 14:31 ` Antonin Godard
  1 sibling, 0 replies; 3+ messages in thread
From: Antonin Godard @ 2025-01-02 14:31 UTC (permalink / raw)
  To: joerg.sommer, docs

Hi Jörg,

On Thu Jan 2, 2025 at 3:14 PM CET, Jörg Sommer via lists.yoctoproject.org wrote:
> From: Jörg Sommer <joerg.sommer@navimatix.de>
>
> The variable *BB_LOGCONFIG* is part of *BB_ENV_PASSTHROUGH_ADDITIONS* in
> /scripts/oe-buildenv-internal and can therefore be passed as environment
> variable.
>
> Signed-off-by: Jörg Sommer <joerg.sommer@navimatix.de>
> ---
>  .../bitbake-user-manual-execution.rst                 | 11 ++++++-----
>  1 file changed, 6 insertions(+), 5 deletions(-)
>
> diff --git a/bitbake/doc/bitbake-user-manual/bitbake-user-manual-execution.rst b/bitbake/doc/bitbake-user-manual/bitbake-user-manual-execution.rst
> index d58fbb32ea..a1267400ab 100644
> --- a/bitbake/doc/bitbake-user-manual/bitbake-user-manual-execution.rst
> +++ b/bitbake/doc/bitbake-user-manual/bitbake-user-manual-execution.rst
> @@ -671,7 +671,7 @@ logging configuration is merged using the following rules:
>  
>  -  Any keys defined in the ``handlers``, ``formatters``, or ``filters``,
>     will be merged into the same section in the default configuration,
> -   with the user specified keys taking replacing a default one if there
> +   with the user specified keys replacing a default one if there
>     is a conflict. In practice, this means that if both the default
>     configuration and user configuration specify a handler named
>     ``myhandler``, the user defined one will replace the default. To
> @@ -707,9 +707,9 @@ or higher priority to a file called ``hashequiv.log``::
>             }
>         },
>         "formatters": {
> -               "logfileFormatter": {
> -                   "format": "%(name)s: %(levelname)s: %(message)s"
> -               }
> +           "logfileFormatter": {
> +               "format": "%(name)s: %(levelname)s: %(message)s"
> +           }
>         },
>         "loggers": {
>             "BitBake.SigGen.HashEquiv": {
> @@ -723,7 +723,8 @@ or higher priority to a file called ``hashequiv.log``::
>         }
>     }
>  
> -Then set the :term:`BB_LOGCONFIG` variable in ``conf/local.conf``::
> +Then set the :term:`BB_LOGCONFIG` variable in the process environment when

s/in the process environment/as an environment variable/?

Just a suggestion, feel free to ignore it.

> +calling bitbake, or set it in ``conf/local.conf``::
>  
>     BB_LOGCONFIG = "hashequiv.json"
>  

By the looks of it, these patches should be sent to the
bitbake-devel@lists.openembedded.org list, with docs@lists.yoctoproject.org in
CC, and apply to the bitbake repository, not poky.

Antonin

-- 
Antonin Godard, Bootlin
Embedded Linux and Kernel engineering
https://bootlin.com


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-01-02 14:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-01-02 14:14 [PATCH 1/2] bitbake/doc/logging: small clean-up and name environment Jörg Sommer
2025-01-02 14:14 ` [PATCH 2/2] bitbake/doc/logging: convert warn.json to YAML Jörg Sommer
2025-01-02 14:31 ` [docs] [PATCH 1/2] bitbake/doc/logging: small clean-up and name environment Antonin Godard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox