CARVIEW |
Select Language
HTTP/2 302
server: nginx
date: Wed, 16 Jul 2025 12:16:11 GMT
content-type: text/plain; charset=utf-8
content-length: 0
x-archive-redirect-reason: found capture at 20090823060538
location: https://web.archive.org/web/20090823060538/https://code.activestate.com/feeds/tags/logging/
server-timing: captures_list;dur=0.655830, exclusion.robots;dur=0.027575, exclusion.robots.policy;dur=0.013510, esindex;dur=0.013664, cdx.remote;dur=110.048050, LoadShardBlock;dur=279.365622, PetaboxLoader3.datanode;dur=165.738784
x-app-server: wwwb-app219
x-ts: 302
x-tr: 425
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
set-cookie: SERVER=wwwb-app219; path=/
x-location: All
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
HTTP/2 200
server: nginx
date: Wed, 16 Jul 2025 12:16:12 GMT
content-type: application/atom+xml
content-length: 5528
x-archive-orig-date: Sun, 23 Aug 2009 06:05:37 GMT
x-archive-orig-server: Apache/2.2.3 (Red Hat)
x-archive-orig-content-length: 5528
x-archive-orig-expires: Sun, 23 Aug 2009 06:15:37 GMT
x-archive-orig-vary: Cookie
x-archive-orig-last-modified: Sun, 23 Aug 2009 06:05:37 GMT
x-archive-orig-etag: 9628b0a76dd6c40be9abd8504e592795
x-archive-orig-cache-control: max-age=600
x-archive-orig-via: 1.0 box19.activestate.com:3129 (squid/2.6.STABLE21)
x-archive-orig-connection: close
cache-control: max-age=1800
x-archive-guessed-content-type: text/xml
x-archive-guessed-charset: utf-8
memento-datetime: Sun, 23 Aug 2009 06:05:38 GMT
link: ; rel="original", ; rel="timemap"; type="application/link-format", ; rel="timegate", ; rel="first memento"; datetime="Sun, 23 Aug 2009 06:05:38 GMT", ; rel="memento"; datetime="Sun, 23 Aug 2009 06:05:38 GMT", ; rel="last memento"; datetime="Sun, 23 Aug 2009 06:05:38 GMT"
content-security-policy: default-src 'self' 'unsafe-eval' 'unsafe-inline' data: blob: archive.org web.archive.org web-static.archive.org wayback-api.archive.org athena.archive.org analytics.archive.org pragma.archivelab.org wwwb-events.archive.org
x-archive-src: 52_11_20090823032425_crawl103.gpg-c/52_11_20090823060506_crawl103.arc.gz
server-timing: captures_list;dur=0.509162, exclusion.robots;dur=0.019409, exclusion.robots.policy;dur=0.009373, esindex;dur=0.009764, cdx.remote;dur=14.534000, LoadShardBlock;dur=466.822626, PetaboxLoader3.resolve;dur=1054.844290, PetaboxLoader3.datanode;dur=190.771930, load_resource;dur=809.738897
x-app-server: wwwb-app219
x-ts: 200
x-tr: 1327
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
x-location: All
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
accept-ranges: bytes
ActiveState Code: Recipes tagged with "logging" https://code.activestate.com/recipes/tags/logging/ 2009-07-09T11:16:57Z Recently added recipes tagged with "logging" logging to console (Python)
2009-07-09T11:16:57Z Sridhar Ratnakumar https://ActiveState%20Code/recipes/users/4169511/ https://code.activestate.com/recipes/576836/
<p style="color: grey">
Python
recipe 576836
by <a href="/recipes/users/4169511/">Sridhar Ratnakumar</a>
(<a href="/recipes/tags/console/">console</a>, <a href="/recipes/tags/logging/">logging</a>).
Revision 7.
</p>
<p>One usually adds <code>StreamHandler</code> to logger in order to achieve the effect of printing the logging calls to console and not having to use print throughout the code. In this approach, one ignores what messages get printed to stdout and stderr.</p>
<p>The way I recommend is to send INFO to stdout but WARN, DEBUG, ERROR, CRITICAL to stderr. In addition, ERROR messages (excluding other levels) are also printed with a "error: " prefix. There is also a 'verbosity level' feature which means verbosity level 0 prunes DEBUG/tracebacks .. while level 1 allows tracebacks and level 2 also allows DEBUG messages.</p>
<p>To use this recipe, simply call the 'setup_console' method in your program.</p>
Logging to console .. without surprises (Python)
2009-06-25T13:12:55Z Sridhar Ratnakumar https://ActiveState%20Code/recipes/users/4169511/ https://code.activestate.com/recipes/576819/
<p style="color: grey">
Python
recipe 576819
by <a href="/recipes/users/4169511/">Sridhar Ratnakumar</a>
(<a href="/recipes/tags/logging/">logging</a>).
Revision 3.
</p>
<p><code>logging.StreamHandler</code> is not the best way to log to console .. as it prints everything to <code>sys.stderr</code> by default. You can configure it to log to <code>sys.stdout</code> .. but that means even error/exception will be printed to <code>sys.stdout</code>.</p>
Run-Time Configurable Logging (Python)
2009-06-10T05:46:19Z Alex Omoto https://ActiveState%20Code/recipes/users/4170524/ https://code.activestate.com/recipes/576803/
<p style="color: grey">
Python
recipe 576803
by <a href="/recipes/users/4170524/">Alex Omoto</a>
(<a href="/recipes/tags/logging/">logging</a>).
Revision 4.
</p>
<p>The following Python code is an extension to the logging module by allowing logging configuration at run-time. </p>
self-logging exceptions (Python)
2009-05-27T17:43:56Z geremy condra https://ActiveState%20Code/recipes/users/4170000/ https://code.activestate.com/recipes/576781/
<p style="color: grey">
Python
recipe 576781
by <a href="/recipes/users/4170000/">geremy condra</a>
(<a href="/recipes/tags/exception/">exception</a>, <a href="/recipes/tags/logging/">logging</a>, <a href="/recipes/tags/python/">python</a>).
Revision 3.
</p>
<p>Pretty frequently I find myself needing to log my exceptions, and rather than produce a tangled mess of boilerplate code, I went ahead and put together this snippet to act as a base class for all those exceptions.</p>
Sensible Loop Status (Python)
2008-10-05T02:14:52Z David Lambert https://ActiveState%20Code/recipes/users/4167420/ https://code.activestate.com/recipes/576528/
<p style="color: grey">
Python
recipe 576528
by <a href="/recipes/users/4167420/">David Lambert</a>
(<a href="/recipes/tags/debug/">debug</a>, <a href="/recipes/tags/debugging/">debugging</a>, <a href="/recipes/tags/logging/">logging</a>, <a href="/recipes/tags/progress/">progress</a>, <a href="/recipes/tags/status/">status</a>).
</p>
<p>A LoopStatus object tests true according to geometric progression or time intervals. This enables rapid time estimates for long running codes, typically in a loop, without producing copious highly repetitive output.</p>