summaryrefslogtreecommitdiffstats
path: root/meta/classes/logging.bbclass
Commit message (Collapse)AuthorAgeFilesLines
* logging.bbclass: Enclose the tr string in quotesJason Wessel2018-02-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | On some linux hosts image recipes will fail to build as follows: ERROR: build-essential-0.3-r0 do_image_ext3: Usage: bbdebug [123] "message" ERROR: build-essential-0.3-r0 do_image_ext3: Function failed: do_image_ext3 (log file is located at /opt/build/tmp/work/intel_corei7_64-wrs-linux/build-essential/0.3-r0/temp/log.do_image_ext3.43744) ERROR: Logfile of failure stored in: /opt/build/tmp/work/intel_corei7_64-wrs-linux/build-essential/0.3-r0/temp/log.do_image_ext3.43744 ERROR: Task (/opt/layers/meta-overc/meta-build/recipes-core/images/build-essential_0.3.bb:do_image_ext3) failed with exit code '1' Running with bitbake -v -v -v -D we get in the log file: + bbdebug 1 Executing 'dd if=/dev/zero of=/opt/build/tmp/work/intel_corei7_64-wrs-linux/build-essential/0.3-r0/deploy-build-essential-image-complete/build-essential-intel-corei7-64-20180220190510.rootfs.ext3 seek=484486 count=0 bs=1024' + USAGE='Usage: bbdebug [123] "message"' + '[' 3 -lt 2 ']' + DBGLVL=1 + shift ++ echo 1 ++ echo 1 ++ tr -d t ++ tr -d t + NONDIGITS=1 + '[' 1 ']' + bbfatal 'Usage: bbdebug [123] "message"' The debug output tells us that the NONDIGITS check failed to remove the digits using the tr expression. Enclosing the expression in quotes causes it to work properly. (From OE-Core rev: 9e6d283aa9c77685f55a62fa220226d9149ecd7a) Signed-off-by: Jason Wessel <jason.wessel@windriver.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes/logging: allow shell message functions to work in devshellPaul Eggleton2015-07-161-7/+35
| | | | | | | | | | | | | Fix a regression caused by the shell message changes - if you run a shell task's runfile, the task isn't actually running in BitBake and thus the message FIFO won't exist - so we should just fall back to printing the message with echo as we did before so that the run files are still useful. (From OE-Core rev: 607d3306f7abef057693dcb6aac1f7b26880181d) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes/base: fix die() to print the full logPaul Eggleton2015-07-161-0/+8
| | | | | | | | | | | | | | | | | | | The recent change to connect through the shell logging functions caused a regression - bb.error() and bb.fatal() cause a flag to be set internally such that BitBake's UI will not print the full task log on failure; unfortunately we have in a lot of places called die() or bbfatal() within shell functions with a very terse message as a means of exiting out, where we still want to see the full log (and we were previously). We do still want to have fatal errors with proper messages that don't result in the full log being printed, however we can't ignore the typical usage of die(). Having added a mechanism to BitBake to log an error and reset the flag, create a bbfatal_log() function that uses this and call it from die() to restore the previous behaviour. (From OE-Core rev: beec1cf3d22d7dbe85f332a055c72649f4bd3e92) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* classes/logging: make shell message functions output to the consolePaul Eggleton2015-07-121-20/+12
| | | | | | | | | | | | | | | | | | Use the FIFO that is now set up when executing tasks within BitBake to make bbdebug/bbnote/bbwarn/bbplain/bberror/bbfatal output to the console through BitBake's UI (as their python counterparts do) instead of only outputting to the task log. Note that this requires the corresponding change in BitBake that creates the FIFO; without it such messages will end up in a file where the FIFO should have been (but won't cause any other ill effects). Remainder of the fix for [YOCTO #5275]. (From OE-Core rev: f04139fc2a33ef48dc889ce51ea442927db0c134) Signed-off-by: Paul Eggleton <paul.eggleton@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* logging.bbclass: avoid bashism in bbdebug()Patrick Ohly2015-06-231-1/+2
| | | | | | | | | | | | | Checking the bbdebug() debug level parameter with a regular test expression only works in bash. Using tr to filter out digits and then checking whether anything is left achieves the same result and is more portable. (From OE-Core rev: 25cb71799e72d4e0c4fe39653d8b84280d087372) Signed-off-by: Patrick Ohly <patrick.ohly@intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
* logging: add bb* logging mechanisms for bash recipe functionsDarren Hart2011-04-281-0/+72
The following logging mechanisms are to be used in bash functions of recipes. They are intended to map one to one in intention and output format with the python recipe logging functions of a similar naming convention: bb.plain(), bb.note(), etc. For the time being, all of these print only to the task logs. Future enhancements may integrate these calls with the bitbake logging infrastructure, allowing for printing to the console as appropriate. The interface and intention statements reflect that future goal. Once it is in place, no changes will be necessary to recipes using these logging mechanisms. I opted to write new functions instead of modifying the oe* logging functions from base.bbclass (and utils.bbclass in oe) for a couple reasons. First, one of my goals was to generate a uniform logging API between bash and python in recipes. Second, there are no users of oe* logging in meta (oe-core) or meta-yocto, while several oe recipes do use them. I wanted to make a clean start with the freedom to change behavior without forcing the oe recipes to change or experience unexpected logging changes. Eventually, the oe recipes can be migrated to the new bb* logging routines and the existing oe* routines can be retired (deleted). (From OE-Core rev: 7cb3f0206619b725e404282fa7a3ac50b4609f1e) Signed-off-by: Darren Hart <dvhart@linux.intel.com> Cc: Chris Larson <clarson@kergoth.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>