diff options
Diffstat (limited to 'bitbake/doc/bitbake-user-manual/bitbake-user-manual-library-functions.rst')
-rw-r--r-- | bitbake/doc/bitbake-user-manual/bitbake-user-manual-library-functions.rst | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/bitbake/doc/bitbake-user-manual/bitbake-user-manual-library-functions.rst b/bitbake/doc/bitbake-user-manual/bitbake-user-manual-library-functions.rst new file mode 100644 index 0000000000..09e353945b --- /dev/null +++ b/bitbake/doc/bitbake-user-manual/bitbake-user-manual-library-functions.rst | |||
@@ -0,0 +1,59 @@ | |||
1 | .. SPDX-License-Identifier: CC-BY-2.5 | ||
2 | |||
3 | ================= | ||
4 | Library Functions | ||
5 | ================= | ||
6 | |||
7 | | | ||
8 | |||
9 | This chapter lists common library functions available under the ``lib/`` | ||
10 | directory in BitBake. | ||
11 | |||
12 | These functions can be used in recipes or configuration files with | ||
13 | :ref:`inline-Python <bitbake-user-manual/bitbake-user-manual-metadata:Inline | ||
14 | Python Variable Expansion>` or :ref:`Python | ||
15 | <bitbake-user-manual/bitbake-user-manual-metadata:BitBake-Style Python | ||
16 | Functions>` functions. | ||
17 | |||
18 | Logging utilities | ||
19 | ================= | ||
20 | |||
21 | Different logging utilities can be used from Python code in recipes or | ||
22 | configuration files. | ||
23 | |||
24 | The strings passed below can be formatted with ``str.format()``, for example:: | ||
25 | |||
26 | bb.warn("Houston, we have a %s", "bit of a problem") | ||
27 | |||
28 | Formatted string can also be used directly:: | ||
29 | |||
30 | bb.error("%s, we have a %s" % ("Houston", "big problem")) | ||
31 | |||
32 | Python f-strings may also be used:: | ||
33 | |||
34 | h = "Houston" | ||
35 | bb.fatal(f"{h}, we have a critical problem") | ||
36 | |||
37 | .. automodule:: bb | ||
38 | :members: | ||
39 | debug, | ||
40 | error, | ||
41 | erroronce, | ||
42 | fatal, | ||
43 | note, | ||
44 | plain, | ||
45 | verbnote, | ||
46 | warn, | ||
47 | warnonce, | ||
48 | |||
49 | ``bb.utils`` | ||
50 | ============ | ||
51 | |||
52 | .. automodule:: bb.utils | ||
53 | :members: | ||
54 | :exclude-members: | ||
55 | LogCatcher, | ||
56 | PrCtlError, | ||
57 | VersionStringException, | ||
58 | better_compile, | ||
59 | better_exec, | ||