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 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209
|
<!doctype html PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Python: module Asterisk.Logging</title>
</head><body bgcolor="#f0f0f8">
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="heading">
<tr bgcolor="#7799ee">
<td valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"> <br><big><big><strong><a href="Asterisk.html"><font color="#ffffff">Asterisk</font></a>.Logging</strong></big></big></font></td
><td align=right valign=bottom
><font color="#ffffff" face="helvetica, arial"><a href=".">index</a><br><a href="file:/usr/src/ks-voip/py-asterisk/Asterisk/Logging.py">/usr/src/ks-voip/py-asterisk/Asterisk/Logging.py</a></font></td></tr></table>
<p><tt>Asterisk/Logging.py: extensions to the Python 2.3 logging module.</tt></p>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#aa55cc">
<td colspan=3 valign=bottom> <br>
<font color="#fffff" face="helvetica, arial"><big><strong>Modules</strong></big></font></td></tr>
<tr><td bgcolor="#aa55cc"><tt> </tt></td><td> </td>
<td width="100%"><table width="100%" summary="list"><tr><td width="25%" valign=top><a href="logging.html">logging</a><br>
</td><td width="25%" valign=top></td><td width="25%" valign=top></td><td width="25%" valign=top></td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ee77aa">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Classes</strong></big></font></td></tr>
<tr><td bgcolor="#ee77aa"><tt> </tt></td><td> </td>
<td width="100%"><dl>
<dt><font face="helvetica, arial"><a href="logging.html#Logger">logging.Logger</a>(<a href="logging.html#Filterer">logging.Filterer</a>)
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="Asterisk.Logging.html#AsteriskLogger">AsteriskLogger</a>
</font></dt></dl>
</dd>
<dt><font face="helvetica, arial"><a href="__builtin__.html#object">__builtin__.object</a>
</font></dt><dd>
<dl>
<dt><font face="helvetica, arial"><a href="Asterisk.Logging.html#InstanceLogger">InstanceLogger</a>
</font></dt></dl>
</dd>
</dl>
<p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="AsteriskLogger">class <strong>AsteriskLogger</strong></a>(<a href="logging.html#Logger">logging.Logger</a>)</font></td></tr>
<tr><td bgcolor="#ffc8d8"><tt> </tt></td><td> </td>
<td width="100%"><dl><dt>Method resolution order:</dt>
<dd><a href="Asterisk.Logging.html#AsteriskLogger">AsteriskLogger</a></dd>
<dd><a href="logging.html#Logger">logging.Logger</a></dd>
<dd><a href="logging.html#Filterer">logging.Filterer</a></dd>
</dl>
<hr>
Methods defined here:<br>
<dl><dt><a name="AsteriskLogger-io"><strong>io</strong></a>(self, msg, *args, **kwargs)</dt><dd><tt>Log a message with severity 'IO' on this logger.</tt></dd></dl>
<dl><dt><a name="AsteriskLogger-packet"><strong>packet</strong></a>(self, msg, *args, **kwargs)</dt><dd><tt>Log a message with severity 'PACKET' on this logger.</tt></dd></dl>
<dl><dt><a name="AsteriskLogger-state"><strong>state</strong></a>(self, msg, *args, **kwargs)</dt><dd><tt>Log a message with severity 'STATE' on this logger.</tt></dd></dl>
<hr>
Methods inherited from <a href="logging.html#Logger">logging.Logger</a>:<br>
<dl><dt><a name="AsteriskLogger-__init__"><strong>__init__</strong></a>(self, name, level<font color="#909090">=0</font>)</dt><dd><tt>Initialize the logger with a name and an optional level.</tt></dd></dl>
<dl><dt><a name="AsteriskLogger-addHandler"><strong>addHandler</strong></a>(self, hdlr)</dt><dd><tt>Add the specified handler to this logger.</tt></dd></dl>
<dl><dt><a name="AsteriskLogger-callHandlers"><strong>callHandlers</strong></a>(self, record)</dt><dd><tt>Pass a record to all relevant handlers.<br>
<br>
Loop through all handlers for this logger and its parents in the<br>
logger hierarchy. If no handler was found, output a one-off error<br>
message to sys.stderr. Stop searching up the hierarchy whenever a<br>
logger with the "propagate" attribute set to zero is found - that<br>
will be the last logger whose handlers are called.</tt></dd></dl>
<dl><dt><a name="AsteriskLogger-critical"><strong>critical</strong></a>(self, msg, *args, **kwargs)</dt><dd><tt>Log 'msg % args' with severity 'CRITICAL'.<br>
<br>
To pass exception information, use the keyword argument exc_info with<br>
a true value, e.g.<br>
<br>
logger.<a href="#AsteriskLogger-critical">critical</a>("Houston, we have a %s", "major disaster", exc_info=1)</tt></dd></dl>
<dl><dt><a name="AsteriskLogger-debug"><strong>debug</strong></a>(self, msg, *args, **kwargs)</dt><dd><tt>Log 'msg % args' with severity 'DEBUG'.<br>
<br>
To pass exception information, use the keyword argument exc_info with<br>
a true value, e.g.<br>
<br>
logger.<a href="#AsteriskLogger-debug">debug</a>("Houston, we have a %s", "thorny problem", exc_info=1)</tt></dd></dl>
<dl><dt><a name="AsteriskLogger-error"><strong>error</strong></a>(self, msg, *args, **kwargs)</dt><dd><tt>Log 'msg % args' with severity 'ERROR'.<br>
<br>
To pass exception information, use the keyword argument exc_info with<br>
a true value, e.g.<br>
<br>
logger.<a href="#AsteriskLogger-error">error</a>("Houston, we have a %s", "major problem", exc_info=1)</tt></dd></dl>
<dl><dt><a name="AsteriskLogger-exception"><strong>exception</strong></a>(self, msg, *args)</dt><dd><tt>Convenience method for logging an ERROR with exception information.</tt></dd></dl>
<dl><dt><a name="AsteriskLogger-fatal"><strong>fatal</strong></a> = critical(self, msg, *args, **kwargs)</dt><dd><tt>Log 'msg % args' with severity 'CRITICAL'.<br>
<br>
To pass exception information, use the keyword argument exc_info with<br>
a true value, e.g.<br>
<br>
logger.<a href="#AsteriskLogger-critical">critical</a>("Houston, we have a %s", "major disaster", exc_info=1)</tt></dd></dl>
<dl><dt><a name="AsteriskLogger-findCaller"><strong>findCaller</strong></a>(self)</dt><dd><tt>Find the stack frame of the caller so that we can note the source<br>
file name and line number.</tt></dd></dl>
<dl><dt><a name="AsteriskLogger-getEffectiveLevel"><strong>getEffectiveLevel</strong></a>(self)</dt><dd><tt>Get the effective level for this logger.<br>
<br>
Loop through this logger and its parents in the logger hierarchy,<br>
looking for a non-zero logging level. Return the first one found.</tt></dd></dl>
<dl><dt><a name="AsteriskLogger-handle"><strong>handle</strong></a>(self, record)</dt><dd><tt>Call the handlers for the specified record.<br>
<br>
This method is used for unpickled records received from a socket, as<br>
well as those created locally. <a href="logging.html#Logger">Logger</a>-level filtering is applied.</tt></dd></dl>
<dl><dt><a name="AsteriskLogger-info"><strong>info</strong></a>(self, msg, *args, **kwargs)</dt><dd><tt>Log 'msg % args' with severity 'INFO'.<br>
<br>
To pass exception information, use the keyword argument exc_info with<br>
a true value, e.g.<br>
<br>
logger.<a href="#AsteriskLogger-info">info</a>("Houston, we have a %s", "interesting problem", exc_info=1)</tt></dd></dl>
<dl><dt><a name="AsteriskLogger-isEnabledFor"><strong>isEnabledFor</strong></a>(self, level)</dt><dd><tt>Is this logger enabled for level 'level'?</tt></dd></dl>
<dl><dt><a name="AsteriskLogger-log"><strong>log</strong></a>(self, level, msg, *args, **kwargs)</dt><dd><tt>Log 'msg % args' with the severity 'level'.<br>
<br>
To pass exception information, use the keyword argument exc_info with<br>
a true value, e.g.<br>
<br>
logger.<a href="#AsteriskLogger-log">log</a>(level, "We have a %s", "mysterious problem", exc_info=1)</tt></dd></dl>
<dl><dt><a name="AsteriskLogger-makeRecord"><strong>makeRecord</strong></a>(self, name, level, fn, lno, msg, args, exc_info)</dt><dd><tt>A factory method which can be overridden in subclasses to create<br>
specialized LogRecords.</tt></dd></dl>
<dl><dt><a name="AsteriskLogger-removeHandler"><strong>removeHandler</strong></a>(self, hdlr)</dt><dd><tt>Remove the specified handler from this logger.</tt></dd></dl>
<dl><dt><a name="AsteriskLogger-setLevel"><strong>setLevel</strong></a>(self, level)</dt><dd><tt>Set the logging level of this logger.</tt></dd></dl>
<dl><dt><a name="AsteriskLogger-warn"><strong>warn</strong></a> = warning(self, msg, *args, **kwargs)</dt><dd><tt>Log 'msg % args' with severity 'WARNING'.<br>
<br>
To pass exception information, use the keyword argument exc_info with<br>
a true value, e.g.<br>
<br>
logger.<a href="#AsteriskLogger-warning">warning</a>("Houston, we have a %s", "bit of a problem", exc_info=1)</tt></dd></dl>
<dl><dt><a name="AsteriskLogger-warning"><strong>warning</strong></a>(self, msg, *args, **kwargs)</dt><dd><tt>Log 'msg % args' with severity 'WARNING'.<br>
<br>
To pass exception information, use the keyword argument exc_info with<br>
a true value, e.g.<br>
<br>
logger.<a href="#AsteriskLogger-warning">warning</a>("Houston, we have a %s", "bit of a problem", exc_info=1)</tt></dd></dl>
<hr>
Data and other attributes inherited from <a href="logging.html#Logger">logging.Logger</a>:<br>
<dl><dt><strong>manager</strong> = <logging.Manager instance></dl>
<dl><dt><strong>root</strong> = <logging.RootLogger instance></dl>
<hr>
Methods inherited from <a href="logging.html#Filterer">logging.Filterer</a>:<br>
<dl><dt><a name="AsteriskLogger-addFilter"><strong>addFilter</strong></a>(self, filter)</dt><dd><tt>Add the specified filter to this handler.</tt></dd></dl>
<dl><dt><a name="AsteriskLogger-filter"><strong>filter</strong></a>(self, record)</dt><dd><tt>Determine if a record is loggable by consulting all the filters.<br>
<br>
The default is to allow the record to be logged; any filter can veto<br>
this and the record is then dropped. Returns a zero value if a record<br>
is to be dropped, else non-zero.</tt></dd></dl>
<dl><dt><a name="AsteriskLogger-removeFilter"><strong>removeFilter</strong></a>(self, filter)</dt><dd><tt>Remove the specified filter from this handler.</tt></dd></dl>
</td></tr></table> <p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#ffc8d8">
<td colspan=3 valign=bottom> <br>
<font color="#000000" face="helvetica, arial"><a name="InstanceLogger">class <strong>InstanceLogger</strong></a>(<a href="__builtin__.html#object">__builtin__.object</a>)</font></td></tr>
<tr><td bgcolor="#ffc8d8"><tt> </tt></td><td> </td>
<td width="100%">Methods defined here:<br>
<dl><dt><a name="InstanceLogger-getLogger"><strong>getLogger</strong></a>(self)</dt><dd><tt>Return the <a href="logging.html#Logger">Logger</a> instance which receives debug messages for this class<br>
instance.</tt></dd></dl>
<dl><dt><a name="InstanceLogger-getLoggerName"><strong>getLoggerName</strong></a>(self)</dt><dd><tt>Return the name where log messages for this instance is sent.</tt></dd></dl>
<hr>
Data and other attributes defined here:<br>
<dl><dt><strong>__dict__</strong> = <dictproxy object><dd><tt>dictionary for instance variables (if defined)</tt></dl>
<dl><dt><strong>__weakref__</strong> = <attribute '__weakref__' of 'InstanceLogger' objects><dd><tt>list of weak references to the <a href="__builtin__.html#object">object</a> (if defined)</tt></dl>
</td></tr></table></td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#55aa55">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Data</strong></big></font></td></tr>
<tr><td bgcolor="#55aa55"><tt> </tt></td><td> </td>
<td width="100%"><strong>__Id__</strong> = '$Id: Asterisk.Logging.html 103 2004-10-17 21:00:47Z dw $'<br>
<strong>__author__</strong> = 'David M. Wilson <dw-py-Asterisk-Util.py@botanicus.net>'</td></tr></table><p>
<table width="100%" cellspacing=0 cellpadding=2 border=0 summary="section">
<tr bgcolor="#7799ee">
<td colspan=3 valign=bottom> <br>
<font color="#ffffff" face="helvetica, arial"><big><strong>Author</strong></big></font></td></tr>
<tr><td bgcolor="#7799ee"><tt> </tt></td><td> </td>
<td width="100%">David M. Wilson <dw-py-Asterisk-Util.py@botanicus.net></td></tr></table>
</body></html>
|