From patchwork Thu Jan 2 14:14:27 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?J=C3=B6rg_Sommer?= X-Patchwork-Id: 54912 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from aws-us-west-2-korg-lkml-1.web.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.lore.kernel.org (Postfix) with ESMTP id 812C2E77188 for ; Thu, 2 Jan 2025 14:14:49 +0000 (UTC) Received: from EUR02-DB5-obe.outbound.protection.outlook.com (EUR02-DB5-obe.outbound.protection.outlook.com [40.107.249.127]) by mx.groups.io with SMTP id smtpd.web10.8820.1735827275194191679 for ; Thu, 02 Jan 2025 06:14:37 -0800 Authentication-Results: mx.groups.io; dkim=fail reason="dkim: body hash did not verify" header.i=@navimatix.de header.s=selector1 header.b=meyzAxgZ; spf=pass (domain: navimatix.de, ip: 40.107.249.127, mailfrom: joerg.sommer@navimatix.de) ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=B9FhnVyPfbVmJX7tuZhccZArAkojZWJIvTLEgfpY0Wv1ZPlc22VQYFrwp+SGICLRhGYf6r8BH8LOApJEH0+tG4wvXxBsoNXsYcWh6L6gcA9fB8nNLBUW17RAv0dy7UP6MAhRMJzmouQBcfRgnpBrDAZfkCDjU8CxUxk0YyEhmb0//7uXiPaY9rBLWuQ0tQSSGXu/63TCeSC1rpGO2zojSdj2A+C7tLZIupqCoxqrzug58moaxcGhLFNjbkFnwoRahLFzoYb+H1XQX/tTLYeeKZyYHlTDqrtJ0TTAedisNqtel3qikLAj2bcTqxZ6JCyJcWXF3SpCfjurhlMv+d/AgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=V5TiMt1/YgWNbm9PcTNNexlWd3SyqU7LPqDPMfCPS7I=; b=J8kLfvxi+Vyb9p3QH29fcC/sBhmuYPCskswRKKqadLW50kLDl7cuvBYjP+gBDWW8b/rTwiLADu2RqwL7shCHQBqdjZVh1UjkKTPCLUukFPAv7mjOazSn5YlHs7TYuyJA8Snqgu7m1WhkoFPKUPlWfZp7WB8+fLiFyb32pr9HWTpjZsoc8WgHcIfZkbc1vZ0lkpe/HmtFJOmHa63vvGn1hFAtdTWEu9N7VUJe1G84A3RpN9/w4IoUXQoT8HrdlC9MA5iaQU63Ym/W/eLnmXJtY4LR53uvKt6JFxXVB6rAGYhJ2imUl43D663/9l5Zdpajsbe6uzzWbc0uAuQb8W4D1A== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=navimatix.de; dmarc=pass action=none header.from=navimatix.de; dkim=pass header.d=navimatix.de; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=navimatix.de; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=V5TiMt1/YgWNbm9PcTNNexlWd3SyqU7LPqDPMfCPS7I=; b=meyzAxgZ1sikfiTf2/i0OGMa1vHoPI73troD8s8FPVVGNG7AdyjVrh8vY7ugb3VmqoJKoEn1vyF65GvuQnKhggVD6tE+67vPOP+8+h2LIpzjKFzCcCPtSsjCL3ODvvXlumZi2f2FPmiXOiuLTxyiyE8ROx8aVlfr2+4NEiD7wx8= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=navimatix.de; Received: from DU2PR01MB8293.eurprd01.prod.exchangelabs.com (2603:10a6:10:2d4::5) by DB9PR01MB8192.eurprd01.prod.exchangelabs.com (2603:10a6:10:2c5::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8314.13; Thu, 2 Jan 2025 14:14:29 +0000 Received: from DU2PR01MB8293.eurprd01.prod.exchangelabs.com ([fe80::d520:1b9e:a30e:69a7]) by DU2PR01MB8293.eurprd01.prod.exchangelabs.com ([fe80::d520:1b9e:a30e:69a7%4]) with mapi id 15.20.8314.013; Thu, 2 Jan 2025 14:14:28 +0000 Date: Thu, 2 Jan 2025 15:14:27 +0100 From: =?utf-8?b?SsO2cmc=?= Sommer To: docs@lists.yoctoproject.org, joerg.sommer@navimatix.de CC: =?utf-8?b?SsO2cmc=?= Sommer Subject: [PATCH 2/2] bitbake/doc/logging: convert warn.json to YAML Message-ID: X-Mailer: git-send-email 2.45.2 References: <9423e2349e9c4f8e5b3a9490e4539156db533e02.1735826398.git.joerg.sommer@navimatix.de> Content-Disposition: inline In-Reply-To: <9423e2349e9c4f8e5b3a9490e4539156db533e02.1735826398.git.joerg.sommer@navimatix.de> X-ClientProxiedBy: BE1P281CA0211.DEUP281.PROD.OUTLOOK.COM (2603:10a6:b10:88::16) To DU2PR01MB8293.eurprd01.prod.exchangelabs.com (2603:10a6:10:2d4::5) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PR01MB8293:EE_|DB9PR01MB8192:EE_ X-MS-Office365-Filtering-Correlation-Id: 4b0b0e09-1e17-41c0-f281-08dd2b37c53f X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|366016; X-Microsoft-Antispam-Message-Info: kPxkntgJW43mi+X1V9da3FEb4Mqh+dqrgWSGAeh+o/4duAKR0aRL7qsVLOLQUexR4zeJG7i3L/PJJLNY1LS8Opeb6lA83Y71vxDcW6TLUmHejUgFfdV80rkRe9tI1H4WHVg4Md3NvqX190o2oFoBVvDweNujQoMlW5wouCtyAUGSIwGMTvYY8AAWTyV7XAHc8IBxM56PAA76V5yKQWPnKPLnMWw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ltTPJMIPxpeLswXJ4XU7wVJCJIfH5NRlXPRagRfhH2/0cI2hlsytXxxbnsgy7QA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:DU2PR01MB8293.eurprd01.prod.exchangelabs.com;PTR:;CAT:NONE;SFS:(13230040)(1800799024)(376014)(366016);DIR:OUT;SFP:1102; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: WkJnOXduuqa+6hGoDvPpnCfr5SH7CSnRmNRrmDQ6HEkpArQkL8oRaXgp/fIxAPlm8wVmhRnTP4stQiyBFPbV5v/FMkF0qMiCzxvhbgFZOoygbCb3lUVy/1Pc8khGAuvEyS0kaagQ/UDgXYPQg53ROkA0JGT/hg+6148tB9EzpwB6+Roi+3QErbNDyrI0JedH96/i5WHO4j0flYO8cs89mKS0LBY3bMpFk7HWIsOlxWgfZ/yW121pelpNVlN9Hpj+BTPj8L/onGshQQ91UVr1FnMyNww1+nIRHAD1GP9BKVzhIntLnnJ69zB2KeISN5AsFcEtdEqpXVs6NbqCKOCrM3sTci5VStVUPPZYTZsunaMKgZngLhX6g1cIKh8XU98gVFSQgqvp29Pyf4oOu6h+QKh+quszg1HSTZzg7+KQVNzAOEWDsVUZ8lyXU/2jRcaQSr146y3ZNa1KmZovCAMyeKyykOiefCYpZwKKKx+bMemllW6+26MfGBDhPur/ZXV8gtsKIbN3sojmUa4K6plnuKh+acWY/FzrHSHe4ktkaGgXjRnxTH6hYPHmJua5o8IMvWBmMPtMa0Gijw5QshpZLJYEzdZ6iYZ6rC9Hd1MqcNT1BzaHS59IKp2KZ5hLH67ApZeVWsrYCXG3GNFD8nA4wfxD63Y6e1GEWfi5ICvYR/kurjvveRaSkksqBRsM27BsBIqADS7We93EUe/f5POgJLKDWsHbjhLGWbO84vi0fCaGbn719ULZhJn3ruBT+46ea8/Wg6n8cvjYec1LGOnuZJtmHJKxKO2V8cuEgHnPGH/zvz979Hg73IvTbqmzKgGdLFfgZo/AWlXN+LfBovBAJQmZKk0uVEBycb3j7BB25QU5/6pSXxBAwKRohBr90qY4yKcxKj4VkINRvzu0b4j0XoED95vXyXrmSV13k6XiQ95IEoBiRMzsBh9UgtZXEszCulpXQxJFLDUkpzp5TSWo/wB5u+c/XkcQgzhfhvgMOYhpW1PNZbAsB1DX7c7tOifslzl54grqee1I1wjG0CKUsZQ0ERRAxrf7NQgrr6m8RMfspqDCBdgh5JMr+b766SgqIs8OhFLl0iL9nYhXwfcaFtjEP+DERqupi6TTbPy0cCDG0opniLr2rqiyKBTmA+5qY+cTUBh9GD/1flryJjXhrqg1aKXtf3BeRwYxmaOLHCjB16dp2PAj29bo+nLp6f3jSGzeCy3Q1J6vSr3tqIxAxZwMtRWjiC1ZFbVDuVoaybUy/gsrvjyTaTv2o62SeVeQW8R1hzeSjRazH02Nmk9IlPPxYKyCap6cNauUofpNeB4gR1BYWz56R1DirKivWw1OhgauiO2rx/BIzcuUs38vFOr5xvLhR5DS+OslRGIHCTL4ERlPCAb1zOZgaWtJ9E1HN9wtqY//ERi8K2kqu+4HW0SiT2zHeE+pSiLfu/hXARzX+2UTwDqaCLnJfeHyB3VKL4QMvmJ7Ufg3YImTh2etKoEAFEa+bGr8mNLvh8TgXwxequx/b8oowy0HBcOx+P+D7pKkRuhisRRonaMIGN1HILzPcXs31kYeSUK7hP4IAd6JXGN3Y9zBJumuDBPgeq1CFuxiLnQJvjv3ZHHJd1YDzw== X-OriginatorOrg: navimatix.de X-MS-Exchange-CrossTenant-Network-Message-Id: 4b0b0e09-1e17-41c0-f281-08dd2b37c53f X-MS-Exchange-CrossTenant-AuthSource: DU2PR01MB8293.eurprd01.prod.exchangelabs.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 02 Jan 2025 14:14:28.9650 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: c87b4f54-b992-4813-8f3f-4a876324197f X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: 8FkikPUrazcRTNRUsTAC9BG3Z/7X4upDSWnShmcBRSHiJ86V9A3wmK+K/rB0m9TSFQo9NL7IjqaJNNl4UXa6EdXomQq5mT6TnkKC719RzRw= X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR01MB8192 List-Id: X-Webhook-Received: from li982-79.members.linode.com [45.33.32.79] by aws-us-west-2-korg-lkml-1.web.codeaurora.org with HTTPS for ; Thu, 02 Jan 2025 14:14:49 -0000 X-Groupsio-URL: https://lists.yoctoproject.org/g/docs/message/6055 From: Jörg Sommer 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 --- .../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``.