From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io1-f54.google.com (mail-io1-f54.google.com [209.85.166.54]) by mail.openembedded.org (Postfix) with ESMTP id 78D4B61B62 for ; Mon, 9 Mar 2020 16:34:13 +0000 (UTC) Received: by mail-io1-f54.google.com with SMTP id d15so9773350iog.3 for ; Mon, 09 Mar 2020 09:34:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=hr9dryjHTlhNSJ9Ns5uD940C1U8021JNCYHN/HwNR1s=; b=qQutinFAb3qk9paqVGFLi6p+Y5pYaJ2Z5SeZPEHokO7DuHd9bC/URKvDhRY8sF/lkP xbiCqhswblVyQiRaV8raBNGmurhE27Lm2V69fA6asWyaP2sgMwHVLTRHzgpbRkdG8+LI Q59AujP1DjOoTuZSOe4jL+4MQMVT/bdx+LdB1yW9sTT6xqzoe+3rY9rKrrJIzHHgKfqg LLu0+MBj0lM5vGdY8a0SQix34WMbu4QxEoQEoRytp1SsJksJE8oAr4EckOE5t2LQ0an6 5ex29vNLdhxDTu4DxS5xZs4/GoROus7V/zJhHuJ0nwy1TAoZt4ze4zxpaMQaki+XDKC0 gNrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=hr9dryjHTlhNSJ9Ns5uD940C1U8021JNCYHN/HwNR1s=; b=R4fUczVf8e9lbT0aQCmDpdY3PgGrjHXUNy58xaPRHUCIiw4HJNVQSv+3Jczld+kryx juVBXge/VT9949C3lcuZjHs8LboB6bAnOEljzFxGM0TuihBrrTlTZBuidM8TDdPC4/QR uzSydTb8v+FDxjIJnwWzt8mRJGrurAMEUv1EcgafMFFpkg+s9CrpP9loOk8rJ8hvGn+G 1HycS/qtc4Mie8ox7UyPK7vL6G2lJZ3aiWk8AJhlqqrOWxLWhQJiVUHt07OvM3Gj/SUX ZatGVmf7wwrMJw70rwI4sPpmMQ6Ad4d1ZqFWl9shnBNIHYHt3Bztn0s2r84ZVx1LrDW8 rGzw== X-Gm-Message-State: ANhLgQ2DvfzREdROCjFYu/SFn2xL45q0GOFjKYmoBp/ctq45i5F4MAON xQYz71KG3rbfWZ7WHvMvSNNzenu23Rw= X-Google-Smtp-Source: ADFU+vtAShaCwGCu2lIM7yfk1qAp5Lgl2VJZ7NdpgtsooDJDrd+7TaZa5U+tdnOUA5dOQfGZt/aI+A== X-Received: by 2002:a02:a610:: with SMTP id c16mr15754992jam.43.1583771654264; Mon, 09 Mar 2020 09:34:14 -0700 (PDT) Received: from OLA-8C37N23.ad.garmin.com ([204.77.163.55]) by smtp.gmail.com with ESMTPSA id q1sm15049593ile.71.2020.03.09.09.34.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Mar 2020 09:34:13 -0700 (PDT) From: Joshua Watt X-Google-Original-From: Joshua Watt To: bitbake-devel@lists.openembedded.org Date: Mon, 9 Mar 2020 11:33:53 -0500 Message-Id: <20200309163353.15362-16-JPEWhacker@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200309163353.15362-1-JPEWhacker@gmail.com> References: <20200309163353.15362-1-JPEWhacker@gmail.com> Cc: docs@lists.yoctoproject.org Subject: [PATCH 15/15] bitbake-user-manual: Add documentation for BB_LOGCONFIG X-BeenThere: bitbake-devel@lists.openembedded.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: Patches and discussion that advance bitbake development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 09 Mar 2020 16:34:15 -0000 Adds documentation describing how to use the BB_LOGCONFIG variable to enable custom logging. Signed-off-by: Joshua Watt --- .../bitbake-user-manual-execution.xml | 97 +++++++++++++++++++ .../bitbake-user-manual-ref-variables.xml | 11 +++ 2 files changed, 108 insertions(+) diff --git a/bitbake/doc/bitbake-user-manual/bitbake-user-manual-execution.xml b/bitbake/doc/bitbake-user-manual/bitbake-user-manual-execution.xml index 8f606676b4..3b31f748cc 100644 --- a/bitbake/doc/bitbake-user-manual/bitbake-user-manual-execution.xml +++ b/bitbake/doc/bitbake-user-manual/bitbake-user-manual-execution.xml @@ -929,4 +929,101 @@ section. + +
+ Logging + + In addition to the standard command line option to control how + verbose builds are when execute, bitbake also supports user defined + configuration of the + Python logging + facilities through the + BB_LOGCONFIG + variable. This variable defines a json or yaml + logging configuration + that will be intelligently merged into the default configuration. + The logging configuration is merged using the following rules: + + + The user defined configuration will completely replace the default + configuration if top level key + bitbake_merge is set to the value + False. In this case, all other rules + are ignored. + + + The user configuration must have a top level + version which must match the value of + the default configuration. + + + 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 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 prevent the user from inadvertently + replacing a default handler, formatter, or filter, all of + the default ones are named with a prefix of + "BitBake." + + + If a logger is defined by the user with the key + bitbake_merge set to + False, that logger will be completely + replaced by user configuration. In this case, no other + rules will apply to that logger. + + + All user defined filter and + handlers properties for a given logger + will be merged with corresponding properties from the + default logger. For example, if the user configuration adds + a filter called myFilter to the + BitBake.SigGen, and the default + configuration adds a filter called + BitBake.defaultFilter, both filters + will be applied to the logger + + + + + + As an example, consider the following user logging configuration + file which logs all Hash Equivalence related messages of VERBOSE or + higher to a file called hashequiv.log + + { + "version": 1, + "handlers": { + "autobuilderlog": { + "class": "logging.FileHandler", + "formatter": "logfileFormatter", + "level": "DEBUG", + "filename": "hashequiv.log", + "mode": "w" + } + }, + "formatters": { + "logfileFormatter": { + "format": "%(name)s: %(levelname)s: %(message)s" + } + }, + "loggers": { + "BitBake.SigGen.HashEquiv": { + "level": "VERBOSE", + "handlers": ["autobuilderlog"] + }, + "BitBake.RunQueue.HashEquiv": { + "level": "VERBOSE", + "handlers": ["autobuilderlog"] + } + } + } + + +
diff --git a/bitbake/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.xml b/bitbake/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.xml index bae01d90c0..c4bd1f2584 100644 --- a/bitbake/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.xml +++ b/bitbake/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.xml @@ -539,6 +539,17 @@ + BB_LOGCONFIG + + + Specifies the name of a config file that contains the user + logging configuration. See + Logging for additional + information + + + + BB_LOGFMT -- 2.17.1 From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-io1-f52.google.com (mail-io1-f52.google.com [209.85.166.52]) by mx.groups.io with SMTP id smtpd.web11.793.1583771654958724850 for ; Mon, 09 Mar 2020 09:34:15 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@gmail.com header.s=20161025 header.b=qQutinFA; spf=pass (domain: gmail.com, ip: 209.85.166.52, mailfrom: jpewhacker@gmail.com) Received: by mail-io1-f52.google.com with SMTP id f21so5602489iol.6 for ; Mon, 09 Mar 2020 09:34:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=hr9dryjHTlhNSJ9Ns5uD940C1U8021JNCYHN/HwNR1s=; b=qQutinFAb3qk9paqVGFLi6p+Y5pYaJ2Z5SeZPEHokO7DuHd9bC/URKvDhRY8sF/lkP xbiCqhswblVyQiRaV8raBNGmurhE27Lm2V69fA6asWyaP2sgMwHVLTRHzgpbRkdG8+LI Q59AujP1DjOoTuZSOe4jL+4MQMVT/bdx+LdB1yW9sTT6xqzoe+3rY9rKrrJIzHHgKfqg LLu0+MBj0lM5vGdY8a0SQix34WMbu4QxEoQEoRytp1SsJksJE8oAr4EckOE5t2LQ0an6 5ex29vNLdhxDTu4DxS5xZs4/GoROus7V/zJhHuJ0nwy1TAoZt4ze4zxpaMQaki+XDKC0 gNrw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=hr9dryjHTlhNSJ9Ns5uD940C1U8021JNCYHN/HwNR1s=; b=Z8fA/z4SKz3vJmpkc2b1mZ+63NGkIrvyzjf7szcQG/bkSyc20K5N+qR96vrCE51b8F A2Yi7ERo37uPsHlTke2G2Fufg1HSQ14DwGCkHf/B53TDVwwHgYlseN2+vII4FDBdsxw4 u1e/HSGYwblEeOZ87Fdlf/0vpjsCN9GPlOGC588m9P9aXtHaI2Jv/XlvXW+vTFi8qW2b h0+hJ5dbrrrP2NDqDoAnGalu+2Plj1vznrLPF9tbprtT+nJj1e5tb4ilMDnGgt5oRRbn miR68Jw/QW26/DXaUtYXiwh7Qxq9/oC/mbfkVx39fNBHpKW55XpUBd8l8vNDDa426eXr Ijbg== X-Gm-Message-State: ANhLgQ1WpEaBFCmXmoJYxC5K7dfq+/7KMbtB9GT4yOJ07BqJituBKjJT 26bTRrC3UCMIsc9b1KgSsns= X-Google-Smtp-Source: ADFU+vtAShaCwGCu2lIM7yfk1qAp5Lgl2VJZ7NdpgtsooDJDrd+7TaZa5U+tdnOUA5dOQfGZt/aI+A== X-Received: by 2002:a02:a610:: with SMTP id c16mr15754992jam.43.1583771654264; Mon, 09 Mar 2020 09:34:14 -0700 (PDT) Return-Path: Received: from OLA-8C37N23.ad.garmin.com ([204.77.163.55]) by smtp.gmail.com with ESMTPSA id q1sm15049593ile.71.2020.03.09.09.34.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Mar 2020 09:34:13 -0700 (PDT) From: "Joshua Watt" X-Google-Original-From: Joshua Watt To: bitbake-devel@lists.openembedded.org Cc: docs@lists.yoctoproject.org, Joshua Watt Subject: [bitbake-devel][PATCH 15/15] bitbake-user-manual: Add documentation for BB_LOGCONFIG Date: Mon, 9 Mar 2020 11:33:53 -0500 Message-Id: <20200309163353.15362-16-JPEWhacker@gmail.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200309163353.15362-1-JPEWhacker@gmail.com> References: <20200309163353.15362-1-JPEWhacker@gmail.com> Adds documentation describing how to use the BB_LOGCONFIG variable to enable custom logging. Signed-off-by: Joshua Watt --- .../bitbake-user-manual-execution.xml | 97 +++++++++++++++++++ .../bitbake-user-manual-ref-variables.xml | 11 +++ 2 files changed, 108 insertions(+) diff --git a/bitbake/doc/bitbake-user-manual/bitbake-user-manual-execution.xml b/bitbake/doc/bitbake-user-manual/bitbake-user-manual-execution.xml index 8f606676b4..3b31f748cc 100644 --- a/bitbake/doc/bitbake-user-manual/bitbake-user-manual-execution.xml +++ b/bitbake/doc/bitbake-user-manual/bitbake-user-manual-execution.xml @@ -929,4 +929,101 @@ section. + +
+ Logging + + In addition to the standard command line option to control how + verbose builds are when execute, bitbake also supports user defined + configuration of the + Python logging + facilities through the + BB_LOGCONFIG + variable. This variable defines a json or yaml + logging configuration + that will be intelligently merged into the default configuration. + The logging configuration is merged using the following rules: + + + The user defined configuration will completely replace the default + configuration if top level key + bitbake_merge is set to the value + False. In this case, all other rules + are ignored. + + + The user configuration must have a top level + version which must match the value of + the default configuration. + + + 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 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 prevent the user from inadvertently + replacing a default handler, formatter, or filter, all of + the default ones are named with a prefix of + "BitBake." + + + If a logger is defined by the user with the key + bitbake_merge set to + False, that logger will be completely + replaced by user configuration. In this case, no other + rules will apply to that logger. + + + All user defined filter and + handlers properties for a given logger + will be merged with corresponding properties from the + default logger. For example, if the user configuration adds + a filter called myFilter to the + BitBake.SigGen, and the default + configuration adds a filter called + BitBake.defaultFilter, both filters + will be applied to the logger + + + + + + As an example, consider the following user logging configuration + file which logs all Hash Equivalence related messages of VERBOSE or + higher to a file called hashequiv.log + + { + "version": 1, + "handlers": { + "autobuilderlog": { + "class": "logging.FileHandler", + "formatter": "logfileFormatter", + "level": "DEBUG", + "filename": "hashequiv.log", + "mode": "w" + } + }, + "formatters": { + "logfileFormatter": { + "format": "%(name)s: %(levelname)s: %(message)s" + } + }, + "loggers": { + "BitBake.SigGen.HashEquiv": { + "level": "VERBOSE", + "handlers": ["autobuilderlog"] + }, + "BitBake.RunQueue.HashEquiv": { + "level": "VERBOSE", + "handlers": ["autobuilderlog"] + } + } + } + + +
diff --git a/bitbake/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.xml b/bitbake/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.xml index bae01d90c0..c4bd1f2584 100644 --- a/bitbake/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.xml +++ b/bitbake/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.xml @@ -539,6 +539,17 @@
+ BB_LOGCONFIG + + + Specifies the name of a config file that contains the user + logging configuration. See + Logging for additional + information + + + + BB_LOGFMT -- 2.17.1