generic-poky/documentation/ref-manual/eclipse/html/poky-ref-manual/recipe-logging-mechanisms.html

42 lines
2.5 KiB
HTML
Raw Normal View History

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>2.3.7.<2E>Recipe Logging Mechanisms</title>
<link rel="stylesheet" type="text/css" href="../book.css">
<meta name="generator" content="DocBook XSL Stylesheets V1.76.1">
<link rel="home" href="index.html" title="The Yocto Project Reference Manual">
<link rel="up" href="usingpoky-debugging.html" title="2.3.<2E>Debugging Build Failures">
<link rel="prev" href="usingpoky-debugging-variables.html" title="2.3.6.<2E>Variables">
<link rel="next" href="logging-with-python.html" title="2.3.7.1.<2E>Logging With Python">
</head>
<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"><div class="section" title="2.3.7.<2E>Recipe Logging Mechanisms">
<div class="titlepage"><div><div><h3 class="title">
<a name="recipe-logging-mechanisms"></a>2.3.7.<2E>Recipe Logging Mechanisms</h3></div></div></div>
<p>
Best practices exist while writing recipes that both log build progress and
act on build conditions such as warnings and errors.
Both Python and Bash language bindings exist for the logging mechanism:
</p>
<div class="itemizedlist"><ul class="itemizedlist" type="disc">
<li class="listitem"><p><span class="emphasis"><em>Python:</em></span> For Python functions, BitBake
supports several loglevels: <code class="filename">bb.fatal</code>,
<code class="filename">bb.error</code>, <code class="filename">bb.warn</code>,
<code class="filename">bb.note</code>, <code class="filename">bb.plain</code>,
and <code class="filename">bb.debug</code>.</p></li>
<li class="listitem"><p><span class="emphasis"><em>Bash:</em></span> For Bash functions, the same set
of loglevels exist and are accessed with a similar syntax:
<code class="filename">bbfatal</code>, <code class="filename">bberror</code>,
<code class="filename">bbwarn</code>, <code class="filename">bbnote</code>,
<code class="filename">bbplain</code>, and <code class="filename">bbdebug</code>.</p></li>
</ul></div>
<p>
</p>
<p>
For guidance on how logging is handled in both Python and Bash recipes, see the
<code class="filename">logging.bbclass</code> file in the
<code class="filename">meta/classes</code> folder of the
<a class="link" href="../dev-manual/source-directory.html" target="_self">Source Directory</a>.
</p>
</div></body>
</html>