Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 182 lines (166 sloc) 7.856 kb
a71861e Initial commit of 0.9.5-dev docs
Gavin M. Roy authored
1
2
3 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
4 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
5
6
7 <html xmlns="http://www.w3.org/1999/xhtml">
8 <head>
9 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
10
d617d2c Update to 0.9.5
Gavin M. Roy authored
11 <title>log &mdash; Pika 0.9.5 documentation</title>
a71861e Initial commit of 0.9.5-dev docs
Gavin M. Roy authored
12
13 <link rel="stylesheet" href="_static/default.css" type="text/css" />
14 <link rel="stylesheet" href="_static/pygments.css" type="text/css" />
15
16 <script type="text/javascript">
17 var DOCUMENTATION_OPTIONS = {
18 URL_ROOT: '',
d617d2c Update to 0.9.5
Gavin M. Roy authored
19 VERSION: '0.9.5',
a71861e Initial commit of 0.9.5-dev docs
Gavin M. Roy authored
20 COLLAPSE_INDEX: false,
21 FILE_SUFFIX: '.html',
22 HAS_SOURCE: true
23 };
24 </script>
25 <script type="text/javascript" src="_static/jquery.js"></script>
26 <script type="text/javascript" src="_static/underscore.js"></script>
27 <script type="text/javascript" src="_static/doctools.js"></script>
d617d2c Update to 0.9.5
Gavin M. Roy authored
28 <link rel="top" title="Pika 0.9.5 documentation" href="index.html" />
a71861e Initial commit of 0.9.5-dev docs
Gavin M. Roy authored
29 <link rel="next" title="object" href="object.html" />
30 <link rel="prev" title="heartbeat" href="heartbeat.html" />
31 </head>
32 <body>
33 <div class="related">
34 <h3>Navigation</h3>
35 <ul>
36 <li class="right" style="margin-right: 10px">
37 <a href="genindex.html" title="General Index"
38 accesskey="I">index</a></li>
39 <li class="right" >
40 <a href="py-modindex.html" title="Python Module Index"
41 >modules</a> |</li>
42 <li class="right" >
43 <a href="object.html" title="object"
44 accesskey="N">next</a> |</li>
45 <li class="right" >
46 <a href="heartbeat.html" title="heartbeat"
47 accesskey="P">previous</a> |</li>
d617d2c Update to 0.9.5
Gavin M. Roy authored
48 <li><a href="index.html">Pika 0.9.5 documentation</a> &raquo;</li>
a71861e Initial commit of 0.9.5-dev docs
Gavin M. Roy authored
49 </ul>
50 </div>
51
52 <div class="document">
53 <div class="documentwrapper">
54 <div class="bodywrapper">
55 <div class="body">
56
57 <div class="section" id="log">
58 <h1>log<a class="headerlink" href="#log" title="Permalink to this headline">¶</a></h1>
59 <p>pika.log is a wrapper which provides a wrapper for the <a class="reference external" href="http://docs.python.org/library/logging.html">python logging</a> module. Pika registeres itself with the logging.getLogger() method using &#8216;pika&#8217; as the value.</p>
60 <div class="section" id="debugging-decorator">
61 <h2>Debugging Decorator<a class="headerlink" href="#debugging-decorator" title="Permalink to this headline">¶</a></h2>
62 <dl class="function">
63 <dt id="log.method_call">
64 <tt class="descclassname">&#64;</tt><tt class="descclassname">log.</tt><tt class="descname">method_call</tt><a class="headerlink" href="#log.method_call" title="Permalink to this definition">¶</a></dt>
65 <dd></dd></dl>
66
67 <p>For debugging, a log.method_call decorator is available for use that will automatically log the call of that function and all of the parameters passed to it.
68 In addition, there is a color logging.Formatter which makes reading debug output a little easier.</p>
69 </div>
70 <div class="section" id="using-pika-log">
71 <h2>Using pika.log<a class="headerlink" href="#using-pika-log" title="Permalink to this headline">¶</a></h2>
72 <p>To turn Pika debug logging on:</p>
73 <div class="highlight-python"><div class="highlight"><pre><span class="kn">import</span> <span class="nn">pika.log</span>
74 <span class="n">pika</span><span class="o">.</span><span class="n">log</span><span class="o">.</span><span class="n">setup</span><span class="p">(</span><span class="n">pika</span><span class="o">.</span><span class="n">log</span><span class="o">.</span><span class="n">DEBUG</span><span class="p">,</span> <span class="n">color</span><span class="o">=</span><span class="bp">True</span><span class="p">)</span>
75 </pre></div>
76 </div>
77 <p>Once this is done you will receive all low level information about what Pika is doing including the frames it is sending and receiving from RabbitMQ.</p>
78 </div>
79 <div class="section" id="module-log">
80 <span id="module-documentation"></span><h2>Module Documentation<a class="headerlink" href="#module-log" title="Permalink to this headline">¶</a></h2>
81 <dl class="function">
82 <dt>
83 <tt class="descclassname">log.</tt><tt class="descname">method_call</tt><big>(</big><em>method</em><big>)</big></dt>
84 <dd><p>Logging decorator to send the method and arguments to logger.debug</p>
85 </dd></dl>
86
87 <dl class="function">
88 <dt id="log.setup">
89 <tt class="descclassname">log.</tt><tt class="descname">setup</tt><big>(</big><em>level=20</em>, <em>color=False</em><big>)</big><a class="headerlink" href="#log.setup" title="Permalink to this definition">¶</a></dt>
90 <dd><p>Setup Pika logging, useful for console debugging and logging pika info,
91 warning, and error messages.</p>
92 <p>Parameters:</p>
93 <ul>
94 <li><dl class="first docutils">
95 <dt>level: Logging level. One of DEBUG, ERROR, INFO, WARNING.</dt>
96 <dd><p class="first last">Default: INFO</p>
97 </dd>
98 </dl>
99 </li>
100 <li><p class="first">color: Use colorized output. Default: False</p>
101 </li>
102 </ul>
103 </dd></dl>
104
105 <dl class="class">
106 <dt id="log.FormatOutput">
107 <em class="property">class </em><tt class="descclassname">log.</tt><tt class="descname">FormatOutput</tt><big>(</big><em>*args</em>, <em>**kwargs</em><big>)</big><a class="headerlink" href="#log.FormatOutput" title="Permalink to this definition">¶</a></dt>
108 <dd><p>Creates a colorized output format for logging that helps provide easier
109 context in debugging</p>
110 </dd></dl>
111
112 </div>
113 </div>
114
115
116 </div>
117 </div>
118 </div>
119 <div class="sphinxsidebar">
120 <div class="sphinxsidebarwrapper">
121 <h3><a href="index.html">Table Of Contents</a></h3>
122 <ul>
123 <li><a class="reference internal" href="#">log</a><ul>
124 <li><a class="reference internal" href="#debugging-decorator">Debugging Decorator</a></li>
125 <li><a class="reference internal" href="#using-pika-log">Using pika.log</a></li>
126 <li><a class="reference internal" href="#module-log">Module Documentation</a></li>
127 </ul>
128 </li>
129 </ul>
130
131 <h4>Previous topic</h4>
132 <p class="topless"><a href="heartbeat.html"
133 title="previous chapter">heartbeat</a></p>
134 <h4>Next topic</h4>
135 <p class="topless"><a href="object.html"
136 title="next chapter">object</a></p>
137 <h3>This Page</h3>
138 <ul class="this-page-menu">
139 <li><a href="_sources/log.txt"
140 rel="nofollow">Show Source</a></li>
141 </ul>
142 <div id="searchbox" style="display: none">
143 <h3>Quick search</h3>
144 <form class="search" action="search.html" method="get">
145 <input type="text" name="q" size="18" />
146 <input type="submit" value="Go" />
147 <input type="hidden" name="check_keywords" value="yes" />
148 <input type="hidden" name="area" value="default" />
149 </form>
150 <p class="searchtip" style="font-size: 90%">
151 Enter search terms or a module, class or function name.
152 </p>
153 </div>
154 <script type="text/javascript">$('#searchbox').show(0);</script>
155 </div>
156 </div>
157 <div class="clearer"></div>
158 </div>
159 <div class="related">
160 <h3>Navigation</h3>
161 <ul>
162 <li class="right" style="margin-right: 10px">
163 <a href="genindex.html" title="General Index"
164 >index</a></li>
165 <li class="right" >
166 <a href="py-modindex.html" title="Python Module Index"
167 >modules</a> |</li>
168 <li class="right" >
169 <a href="object.html" title="object"
170 >next</a> |</li>
171 <li class="right" >
172 <a href="heartbeat.html" title="heartbeat"
173 >previous</a> |</li>
d617d2c Update to 0.9.5
Gavin M. Roy authored
174 <li><a href="index.html">Pika 0.9.5 documentation</a> &raquo;</li>
a71861e Initial commit of 0.9.5-dev docs
Gavin M. Roy authored
175 </ul>
176 </div>
177 <div class="footer">
178 &copy; Copyright 2011, Tony Garnock-Jones, Gavin M. Roy and others.
179 Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 1.1pre.
180 </div>
181 </body>
182 </html>
Something went wrong with that request. Please try again.