A logging replacement for Python
Project description
An awesome logging implementation that is fun to use.
Quickstart
from logbook import Logger log = Logger('A Fancy Name') log.warn('Logbook is too awesome for most applications') log.error("Can't touch this")
Works for web apps too
from logbook import MailHandler, Processor mailhandler = MailHandler(from_addr='servererror@example.com', recipients=['admin@example.com'], level='ERROR', format_string=u'''\ Subject: Application Error for {record.extra[path]} [{record.extra[method]}] Message type: {record.level_name} Location: {record.filename}:{record.lineno} Module: {record.module} Function: {record.func_name} Time: {record.time:%Y-%m-%d %H:%M:%S} Remote IP: {record.extra[ip]} Request: {record.extra[path]} [{record.extra[method]}] Message: {record.message} ''') def handle_request(request): def inject_extra(record, handler): record.extra['ip'] = request.remote_addr record.extra['method'] = request.method record.extra['path'] = request.path with Processor(inject_extra): with mailhandler: # execute code that might fail in the context of the # request.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Logbook-0.12.2.tar.gz
(164.4 kB
view hashes)
Built Distributions
Logbook-0.12.2-py3.5-linux-x86_64.egg
(282.6 kB
view hashes)
Logbook-0.12.2-py3.4-linux-x86_64.egg
(282.7 kB
view hashes)
Logbook-0.12.2-py3.3-linux-x86_64.egg
(271.8 kB
view hashes)
Logbook-0.12.2-py3.2-linux-x86_64.egg
(267.5 kB
view hashes)
Logbook-0.12.2-py2.7-linux-x86_64.egg
(258.4 kB
view hashes)
Logbook-0.12.2-py2.6-linux-x86_64.egg
(258.0 kB
view hashes)
Close
Hashes for Logbook-0.12.2-py3.5-linux-x86_64.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | a8040972371120ce7d8e1d10d91c4c81fa4eaae728728e897cfb45daa592ed02 |
|
MD5 | 5369811ee064ac853827e0bad0be7829 |
|
BLAKE2b-256 | 0f4892806f0c68144e09b04b6c287ce6936f9fad8ed081f08b090f749f7f57a0 |
Close
Hashes for Logbook-0.12.2-py3.4-linux-x86_64.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 25e93b5243194a5f3650b0702e13afc22eb6b73a7abb09eee2e6cc29befcc265 |
|
MD5 | 3081308dbc30534a67059be1e551e9bd |
|
BLAKE2b-256 | 995036ec99330ac7eca63be1bdd6f798c9a85dc1333599b957e563b4cef94bc1 |
Close
Hashes for Logbook-0.12.2-py3.3-linux-x86_64.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | cdc6a7ac373c2f5ed30b6c29a48f055cf473bafb37c64c5abc6078e4801b5827 |
|
MD5 | c14a889beff1593940e1d7de05d8a1a7 |
|
BLAKE2b-256 | c6ee14317af67666b682d2d9335ee51f53fb5b286986eaea876ea1406bdef195 |
Close
Hashes for Logbook-0.12.2-py3.2-linux-x86_64.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 45df6f5a9b3b7467f9e29b9c4b7148b174213beb9d2c45fe8b367ea3b4a93c02 |
|
MD5 | 5e4d00c287967dc530be37de79aa14f0 |
|
BLAKE2b-256 | f5d5d7e203520a413ece1d3212a0fff80045028a6a1312e8ef9e39ca47e22e5c |
Close
Hashes for Logbook-0.12.2-py2.7-linux-x86_64.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 14dade9ed8c217daf2dee92f8b82d7c58c5a0d0b3df93a2702d715c05fdeeeaf |
|
MD5 | 3725bd534e9de60edeaa7dfe57dda5f8 |
|
BLAKE2b-256 | 081a1044edfc2497b521d7240b8241f24ab285b7f27407318a1f207299d9b73e |
Close
Hashes for Logbook-0.12.2-py2.6-linux-x86_64.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | e291c30c2c3d3721c6a20eef4903e5406c9ef4c0ee37e68f6f3ed61b2d6ddece |
|
MD5 | 859fae4b9fb2a7fad9765a2b5c2f6082 |
|
BLAKE2b-256 | 2208ed6b1e8a0081821d8fb5ff5061f69e21d96b441c25efc904e88b8d85d393 |