/usr/share/doc/python-logutils-doc/html/libraries.html is in python-logutils-doc 0.3.3-1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 | <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Configuring Libraries — Logutils 0.3.3 documentation</title>
<link rel="stylesheet" href="_static/default.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '0.3.3',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<link rel="top" title="Logutils 0.3.3 documentation" href="index.html" />
<link rel="next" title="Working with queues" href="queue.html" />
<link rel="prev" title="Logutils documentation" href="index.html" />
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="queue.html" title="Working with queues"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="index.html" title="Logutils documentation"
accesskey="P">previous</a> |</li>
<li><a href="index.html">Logutils 0.3.3 documentation</a> »</li>
</ul>
</div>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
<div class="section" id="configuring-libraries">
<h1>Configuring Libraries<a class="headerlink" href="#configuring-libraries" title="Permalink to this headline">¶</a></h1>
<p>When developing libraries, you’ll probably need to use the
<a class="reference internal" href="#logutils.NullHandler" title="logutils.NullHandler"><tt class="xref py py-class docutils literal"><span class="pre">NullHandler</span></tt></a> class.</p>
<p><strong>N.B.</strong> This is part of the standard library since Python 2.7 / 3.1, so the
version here is for use with earlier Python versions.</p>
<p>Typical usage:</p>
<div class="highlight-python"><div class="highlight"><pre><span class="kn">import</span> <span class="nn">logging</span>
<span class="k">try</span><span class="p">:</span>
<span class="kn">from</span> <span class="nn">logging</span> <span class="kn">import</span> <span class="n">NullHandler</span>
<span class="k">except</span> <span class="ne">ImportError</span><span class="p">:</span>
<span class="kn">from</span> <span class="nn">logutils</span> <span class="kn">import</span> <span class="n">NullHandler</span>
<span class="c"># use this in all your library's subpackages/submodules</span>
<span class="n">logger</span> <span class="o">=</span> <span class="n">logging</span><span class="o">.</span><span class="n">getLogger</span><span class="p">(</span><span class="n">__name__</span><span class="p">)</span>
<span class="c"># use this just in your library's top-level package</span>
<span class="n">logger</span><span class="o">.</span><span class="n">addHandler</span><span class="p">(</span><span class="n">NullHandler</span><span class="p">())</span>
</pre></div>
</div>
<dl class="class">
<dt id="logutils.NullHandler">
<em class="property">class </em><tt class="descclassname">logutils.</tt><tt class="descname">NullHandler</tt><big>(</big><em>level=0</em><big>)</big><a class="headerlink" href="#logutils.NullHandler" title="Permalink to this definition">¶</a></dt>
<dd><p>This handler does nothing. It’s intended to be used to avoid the
“No handlers could be found for logger XXX” one-off warning. This is
important for library code, which may contain code to log events. If a user
of the library does not configure logging, the one-off warning might be
produced; to avoid this, the library developer simply needs to instantiate
a NullHandler and add it to the top-level logger of the library module or
package.</p>
<dl class="method">
<dt id="logutils.NullHandler.createLock">
<tt class="descname">createLock</tt><big>(</big><big>)</big><a class="headerlink" href="#logutils.NullHandler.createLock" title="Permalink to this definition">¶</a></dt>
<dd><p>Since this handler does nothing, it has no underlying I/O to protect
against multi-threaded access, so this method returns <cite>None</cite>.</p>
</dd></dl>
<dl class="method">
<dt id="logutils.NullHandler.emit">
<tt class="descname">emit</tt><big>(</big><em>record</em><big>)</big><a class="headerlink" href="#logutils.NullHandler.emit" title="Permalink to this definition">¶</a></dt>
<dd><p>Emit a record. This does nothing and shouldn’t be called during normal
processing, unless you redefine <a class="reference internal" href="#logutils.NullHandler.handle" title="logutils.NullHandler.handle"><tt class="xref py py-meth docutils literal"><span class="pre">handle()</span></tt></a>.</p>
</dd></dl>
<dl class="method">
<dt id="logutils.NullHandler.handle">
<tt class="descname">handle</tt><big>(</big><em>record</em><big>)</big><a class="headerlink" href="#logutils.NullHandler.handle" title="Permalink to this definition">¶</a></dt>
<dd><p>Handle a record. Does nothing in this class, but in other
handlers it typically filters and then emits the record in a
thread-safe way.</p>
</dd></dl>
</dd></dl>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<h4>Previous topic</h4>
<p class="topless"><a href="index.html"
title="previous chapter">Logutils documentation</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="queue.html"
title="next chapter">Working with queues</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/libraries.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="py-modindex.html" title="Python Module Index"
>modules</a> |</li>
<li class="right" >
<a href="queue.html" title="Working with queues"
>next</a> |</li>
<li class="right" >
<a href="index.html" title="Logutils documentation"
>previous</a> |</li>
<li><a href="index.html">Logutils 0.3.3 documentation</a> »</li>
</ul>
</div>
<div class="footer">
© Copyright 2010-2013, Vinay Sajip.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.
</div>
</body>
</html>
|