diff mbox series

[2/2] doc/logging: convert warn.json to YAML

Message ID bcd0593418a1217f73f4a6946b13a5b603a58fb5.1735852948.git.joerg.sommer@navimatix.de
State New
Headers show
Series [1/2] doc/logging: small clean-up and name environment | expand

Commit Message

Jörg Sommer Jan. 2, 2025, 9:23 p.m. UTC
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 mbox series

Patch

diff --git a/doc/bitbake-user-manual/bitbake-user-manual-execution.rst b/doc/bitbake-user-manual/bitbake-user-manual-execution.rst
index 0e20d5933..99b91ba50 100644
--- a/doc/bitbake-user-manual/bitbake-user-manual-execution.rst
+++ b/doc/bitbake-user-manual/bitbake-user-manual-execution.rst
@@ -728,35 +728,29 @@  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``.