From e22565968828c86983162e67f52ebb106242ca76 Mon Sep 17 00:00:00 2001 From: Joshua Watt Date: Mon, 9 Mar 2020 11:33:53 -0500 Subject: bitbake-user-manual: Add documentation for BB_LOGCONFIG Adds documentation describing how to use the BB_LOGCONFIG variable to enable custom logging. Signed-off-by: Joshua Watt Signed-off-by: Richard Purdie --- .../bitbake-user-manual-execution.xml | 97 ++++++++++++++++++++++ .../bitbake-user-manual-ref-variables.xml | 11 +++ 2 files changed, 108 insertions(+) (limited to 'doc/bitbake-user-manual') diff --git a/doc/bitbake-user-manual/bitbake-user-manual-execution.xml b/doc/bitbake-user-manual/bitbake-user-manual-execution.xml index 8f606676b..3b31f748c 100644 --- a/doc/bitbake-user-manual/bitbake-user-manual-execution.xml +++ b/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/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.xml b/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.xml index bae01d90c..c4bd1f258 100644 --- a/doc/bitbake-user-manual/bitbake-user-manual-ref-variables.xml +++ b/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 -- cgit 1.2.3-korg