bitbake-user-manual-library-functions.rst 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. .. SPDX-License-Identifier: CC-BY-2.5
  2. =================
  3. Library Functions
  4. =================
  5. |
  6. This chapter lists common library functions available under the ``lib/``
  7. directory in BitBake.
  8. These functions can be used in recipes or configuration files with
  9. :ref:`inline-Python <bitbake-user-manual/bitbake-user-manual-metadata:Inline
  10. Python Variable Expansion>` or :ref:`Python
  11. <bitbake-user-manual/bitbake-user-manual-metadata:BitBake-Style Python
  12. Functions>` functions.
  13. Logging utilities
  14. =================
  15. Different logging utilities can be used from Python code in recipes or
  16. configuration files.
  17. The strings passed below can be formatted with ``str.format()``, for example::
  18. bb.warn("Houston, we have a %s", "bit of a problem")
  19. Formatted string can also be used directly::
  20. bb.error("%s, we have a %s" % ("Houston", "big problem"))
  21. Python f-strings may also be used::
  22. h = "Houston"
  23. bb.fatal(f"{h}, we have a critical problem")
  24. .. automodule:: bb
  25. :members:
  26. debug,
  27. error,
  28. erroronce,
  29. fatal,
  30. note,
  31. plain,
  32. verbnote,
  33. warn,
  34. warnonce,
  35. ``bb.utils``
  36. ============
  37. .. automodule:: bb.utils
  38. :members:
  39. :exclude-members:
  40. LogCatcher,
  41. PrCtlError,
  42. VersionStringException,
  43. better_compile,
  44. better_exec,