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.3.2.tar.gz
(84.1 kB
view hashes)
Built Distributions
Logbook-1.3.2-cp36-cp36m-win32.whl
(100.8 kB
view hashes)
Logbook-1.3.2-cp35-cp35m-win32.whl
(100.3 kB
view hashes)
Logbook-1.3.2-cp27-cp27m-win32.whl
(101.2 kB
view hashes)
Close
Hashes for Logbook-1.3.2-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 05af5f25247cfe68ee5d1d366c0c2ec1f0cb601d98930097576d0ee61c438e91 |
|
MD5 | 262d12297583a09aef62bf0b39817bd7 |
|
BLAKE2b-256 | 40b106b61cd943561322589200924b61c485a3916da37459f9952422803299ec |
Close
Hashes for Logbook-1.3.2-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | cbc8f344db394d9b71d64faf1983eaeddcacde15219749db3ed055dc8837379d |
|
MD5 | 3172008c8e5a34f10f3062a652eff7d9 |
|
BLAKE2b-256 | 254bfd41c2c02c929d5c66d2d8c5efb0a69bd0eb3dab9bccf90d2ce7179f8a80 |
Close
Hashes for Logbook-1.3.2-cp35-cp35m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c5f185affa8f79701b8c9d1349debc2f852433eb016ef0c0098061f7e80a6633 |
|
MD5 | a190eb540b369e08e71615626dd2b3ea |
|
BLAKE2b-256 | c85da50ab675356e5067e2b5f248b06a11ca79a817f0a4ecad9b51476bc2aebd |
Close
Hashes for Logbook-1.3.2-cp35-cp35m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c16bec0b8e14907598ad739f2b4e52c468111dea3c27cfe4e2e322a84725eba7 |
|
MD5 | b0e8dde9231c08d2d84b36a34428be8b |
|
BLAKE2b-256 | 3581c55b0f2fde2153821997e27e44ff98270ea0e342deb950dd116a9351e794 |
Close
Hashes for Logbook-1.3.2-cp27-cp27m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f5eba55fe4e11b4d152ddf4e8e9f960673ad510ba083963a4245e326f35d71a8 |
|
MD5 | 1bed6c124e3f166f09e7c1462d8ea922 |
|
BLAKE2b-256 | 4f2526c70b3ebe086a698ed74ec8bc75e44bf12a5784fa3eb010ba60f46d7637 |
Close
Hashes for Logbook-1.3.2-cp27-cp27m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4296e8080a7b15b4686b677c500545a75a6e46f22bfe9d32a6e6ba91b9f806c8 |
|
MD5 | 315fcf660bdb8caf4452c10ec4058498 |
|
BLAKE2b-256 | 739805613ba440ab5ea28f0a5a1de34cb5402704c8d97486537421de84ac26ac |