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.5.1.tar.gz
(152.5 kB
view hashes)
Built Distributions
Logbook-1.5.1-cp37-cp37m-win32.whl
(107.9 kB
view hashes)
Logbook-1.5.1-cp36-cp36m-win32.whl
(107.9 kB
view hashes)
Logbook-1.5.1-cp35-cp35m-win32.whl
(104.1 kB
view hashes)
Logbook-1.5.1-cp27-cp27m-win32.whl
(104.5 kB
view hashes)
Close
Hashes for Logbook-1.5.1-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 70d4dc9a1a69987b6640c1b8f1bac5cc9b97c163692b4254bb01cb0db947df3f |
|
MD5 | 56a9ad28a4012ad73e0867e3a076f3a5 |
|
BLAKE2b-256 | 26e8e7b5182324728777e449122338abf23c34def63168ca619e37ce53addeb3 |
Close
Hashes for Logbook-1.5.1-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1f6fdeb1e9a8a31ba31ce5fffc6df1cc2c95760bf837647a99e81b1dc0f42c94 |
|
MD5 | 4fc1e8a082aa7fdb5d246604057c6e54 |
|
BLAKE2b-256 | 9726d626ea568429a6b4da2865fc36cb533b6bd9827cc1081bc53bfdf435a6fa |
Close
Hashes for Logbook-1.5.1-cp37-cp37m-macosx_10_14_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | acd9731005d5eea52c08f148ace15089b9d7a1a28feba1f379b5f8cff71f7fc1 |
|
MD5 | 5560b25c298e4377c1098cde68ac1d90 |
|
BLAKE2b-256 | a70c1878fc0fdfa859f080e6eebefe4c9bad11e2961a2fc0f4e58b7735d0c128 |
Close
Hashes for Logbook-1.5.1-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b2a25a96fbef79693f83ef29e3747fb60610dc0b5a04b030220c862ef0ec3afe |
|
MD5 | 5593b66d687727015a8808aff8df3724 |
|
BLAKE2b-256 | a93221e6c1dfc14278c2e08b5187251fe969c901c5dac85b08b4ed4b88b4aa4c |
Close
Hashes for Logbook-1.5.1-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e2028fc4156b115ea6a466607fc8ca7d58cd21a042609b4dfff0732d34b51c56 |
|
MD5 | 5cc3fa68f04780dec7fc82e98138f889 |
|
BLAKE2b-256 | 838156ea9ee977020799a940b370604b2842630902d88f8059f0fc1296d5843b |
Close
Hashes for Logbook-1.5.1-cp35-cp35m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c2f55f9fd43098b64c053155670824d10b25930b2a2c5cc5db46e21b2780efeb |
|
MD5 | 1379f8d156197218688fd599df09ff48 |
|
BLAKE2b-256 | dd95cd1636eb34997d7944f5e3c9912fbb1a8befbbc85a5efc34a5b8f215cf36 |
Close
Hashes for Logbook-1.5.1-cp35-cp35m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 08ecc2fdf9ffe1405616b7c821e1f853f1edbc738fe2c6685aed673400e9b4e6 |
|
MD5 | 7a20a22fa6133d2473148402f3cb444e |
|
BLAKE2b-256 | 46321e01b2c1a39c0efe3949df99d9d2fc2f74fef08371eb113aee1eb577209f |
Close
Hashes for Logbook-1.5.1-cp27-cp27m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c946bf6101e461cfea2979036d539e88bb48cbe62f8408b35a50736d3388d5c4 |
|
MD5 | d117d828d54bc3a44c78dcfe8f9b6f59 |
|
BLAKE2b-256 | c07cc1091c577739a09883882d0c74ff6a6e1f85f12d8efb8e57643025c14730 |
Close
Hashes for Logbook-1.5.1-cp27-cp27m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c62f1fada0c1a178687d994c8904872638a4b694b2c0a41ad88e320b1e88ce2c |
|
MD5 | 857aa4cc7c1ecf8076cbed4a04bd41aa |
|
BLAKE2b-256 | ff114980b3c6f640892a01c6c48653cc62bac6520e5dee1ea61e929b4f0d376d |