The Yocto Project provides several logging functions for
producing debugging output and reporting errors and warnings.
For Python functions, the following logging functions exist.
All of these functions log to
${T}/log.do_
task
,
and can also log to standard output (stdout) with the right
settings:
bb.plain(
msg
)
:
Writes msg
as is to the
log while also logging to stdout.
bb.note(
msg
)
:
Writes "NOTE: msg
" to the
log.
Also logs to stdout if BitBake is called with "-v".
bb.debug(
level
,
msg
)
:
Writes "DEBUG: msg
" to the
log.
Also logs to stdout if the log level is greater than or
equal to level
.
See the
"-D"
option in the BitBake User Manual for more information.
bb.warn(
msg
)
:
Writes "WARNING: msg
" to the
log while also logging to stdout.
bb.error(
msg
)
:
Writes "ERROR: msg
" to the
log while also logging to standard out (stdout).
bb.fatal(
msg
)
:
This logging function is similar to
bb.error(
msg
)
but also causes the calling task to fail.
bb.fatal()
raises an exception,
which means you do not need to put a "return"
statement after the function.
The same logging functions are also available in shell
functions, under the names
bbplain
, bbnote
,
bbdebug
, bbwarn
,
bberror
, and bbfatal
.
The
logging
class implements these functions.
See that class in the
meta/classes
folder of the
Source Directory
for information.