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-1.0.0.tar.gz
(178.1 kB
view hashes)
Built Distributions
Close
Hashes for Logbook-1.0.0-cp35-cp35m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e9fccf7d8afa683a513f624dbdee3cfe5c25a5480d15aeb51b49f5de6748cb6f |
|
MD5 | 34e9b823dad207cfd4a34acba2972bab |
|
BLAKE2b-256 | 8b14111a25688ddc5ac66e16c42e5c254cbd4720347921bf718cba11d7d995bf |
Close
Hashes for Logbook-1.0.0-cp35-cp35m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c4745d0bf13f3c597ded4fc8823c04f95b0844511752a4e29576673636adeb29 |
|
MD5 | 074b4bf73d51ce4d4f9f051bc6caedb9 |
|
BLAKE2b-256 | b6113de5cf3d54aba3dbccfcf7f375cd7da680853b9e7aef1d67bc698bbe8df2 |
Close
Hashes for Logbook-1.0.0-cp34-cp34m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 893846917686478046843d381a623dabf059133f333064b05571e62dba9c8222 |
|
MD5 | 06c1187c720b9638eca70d1608e7a9a4 |
|
BLAKE2b-256 | a64e53652e2420ef5bbf920eea7167452e8c91a2bd7f2a734239dc3e10280b74 |
Close
Hashes for Logbook-1.0.0-cp34-cp34m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8ff47108ed32a7e3f3a0f0b4b26a8dbe6df10bf4108d94bd81bfd7a3645dff7f |
|
MD5 | 4ba63f26091f892a378aba84e3083996 |
|
BLAKE2b-256 | 12b51e47ba23d08f5f24d0fb0c5e4bfc612f70291c90a0b10313cd6a110bea94 |
Close
Hashes for Logbook-1.0.0-cp33-cp33m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ce33c6cd1f76d80e06203c0ed5b7dbf27a5504c8ba043eb860c2160ad483338b |
|
MD5 | 92e66fbde691cd8d6b22541fbfd07fc8 |
|
BLAKE2b-256 | b2e63b086079a93a3a23ac734de58c9613e78c67d3b1af70154ca7557a83f7ad |
Close
Hashes for Logbook-1.0.0-cp33-cp33m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dd8aed42845d005a9b680e2341ff040bcd3855295e673241ff51c8bae4902a9b |
|
MD5 | 10ead406e321e860f066d01c49e77a31 |
|
BLAKE2b-256 | 13618d3189c91c6449549abece5fe7223be9389a2066046461e30c9a82e005e5 |
Close
Hashes for Logbook-1.0.0-cp27-cp27m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0f87d372c69e06b4136713126713c1abf5ce8e6c7c977bc325d7b1608c8f5627 |
|
MD5 | e76d129a1dcd76a64bb0bcce20a49ce2 |
|
BLAKE2b-256 | 52af4f28c6b45944d3390522b4e11da073db9ed4980bf874fc6635f8766cf737 |
Close
Hashes for Logbook-1.0.0-cp27-cp27m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 72fb1656849b9ba0c57dcaa1b14da56a252fc2b12311f1d8a6e0a55a2d17ffaa |
|
MD5 | 053c1d2e373b84d684e044b1fd378619 |
|
BLAKE2b-256 | 5aeee61f941d4eba6115fc71ee1e96e99f7585fcdc9d72cf28312958f242596c |
Close
Hashes for Logbook-1.0.0-cp26-cp26m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 012cf121dd0e7474289c4612a41a6ad39f694bf389dd0e4ed4e4e8743aa0a720 |
|
MD5 | c80fd0a7ee17b660ade787d8b70a1fb1 |
|
BLAKE2b-256 | 409b8a0736e6947108659e32dbbdd513eac787f9c1c10bf9852da5d9be700df1 |
Close
Hashes for Logbook-1.0.0-cp26-cp26m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8504e2a180e638b14b177ba3f9bf8a85759b7fac4d660ddb917d87cc7bfde8da |
|
MD5 | ed1f27edaf69bc6cbc7ff958683d91be |
|
BLAKE2b-256 | 9d278aed3933efa935238abd9eaf9a4b0b77b087847962435de33a65c0a75c9f |