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.2.tar.gz
(85.7 kB
view hashes)
Built Distributions
Logbook-1.5.2-cp37-cp37m-win32.whl
(107.9 kB
view hashes)
Logbook-1.5.2-cp36-cp36m-win32.whl
(107.9 kB
view hashes)
Logbook-1.5.2-cp35-cp35m-win32.whl
(104.1 kB
view hashes)
Logbook-1.5.2-cp27-cp27m-win32.whl
(104.5 kB
view hashes)
Close
Hashes for Logbook-1.5.2-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | de2ede3732a47b6940af1299b5a61524f570fe314a8d9f0cb5646bd7b33a11c6 |
|
MD5 | 7e74ab7cafc850ddb2f59aa11e57bf81 |
|
BLAKE2b-256 | 8f4acf3cf87eee2e7baa04641920b0ad3621eeb193468c47892312a93051b163 |
Close
Hashes for Logbook-1.5.2-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f4c1cbac42b532961e40439d1061ab9c61546851ce9b3a4ab7ed5ef05acfb07d |
|
MD5 | 357dabcfeb4e3c1d35acb4f43df2035c |
|
BLAKE2b-256 | 86fbab47bef4dc0c4fabfafbebfbcfa748a614cb41c3ab64e41cc0e493d45b24 |
Close
Hashes for Logbook-1.5.2-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a4192853721f25f543040ea0da010b8df630a5d1f07a2ad9bbd5556c41b04ff6 |
|
MD5 | 83e0b5d65598e5eb44fb1c3503dfbc91 |
|
BLAKE2b-256 | 3662cd4120be01e5fa3abf51f2a4f103947ae0963c8df6e915859a660c8abe1e |
Close
Hashes for Logbook-1.5.2-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6dec7a1aac0efa86c04160d8c2602724b95109c0a84492c41bd30efab240ee56 |
|
MD5 | f38ea713bf3a494f96e741390d8eea4d |
|
BLAKE2b-256 | 560f1d8ac4d904f20a5e9011aa6d280901770db4b387f9c7d533d09f52b812ef |
Close
Hashes for Logbook-1.5.2-cp35-cp35m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2afa44c20465a6629a96f8590910afe7eab1fb5bcd19e1eaf75c92c51428d835 |
|
MD5 | dee055bb69137a3ffb76b233590308bd |
|
BLAKE2b-256 | 3657bf62ecd987f2d92165d53f1418ac973081bbf68f5f90d03ce27e99d4d744 |
Close
Hashes for Logbook-1.5.2-cp35-cp35m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6fb3543e972acb3460fac489db4a1718400226e500dfe4d72990e77cca311549 |
|
MD5 | 6870f53e6572d7f2657013fb4cfa02ac |
|
BLAKE2b-256 | 38360ee53865d7e3c1ae2e49e403e1353e4347f2318676f0b3f12fee687216a8 |
Close
Hashes for Logbook-1.5.2-cp27-cp27m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2d1c4ffd26b2c11587a028b3905aaaa0dc43943106755c3989364553ed6d17c2 |
|
MD5 | 53c9d691c88f93cc56fcedd0fbde4e7c |
|
BLAKE2b-256 | 4810263b3391f76aa477830daf77e11aceb47dc26f278fa3f777eac6b46f9b83 |
Close
Hashes for Logbook-1.5.2-cp27-cp27m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0b523cc67171b273ceb7ea2a530b103793b36941abc70e4f285ea1583d165638 |
|
MD5 | fd60abfe6062afa0eb4d2617abc487db |
|
BLAKE2b-256 | fa7d6eaa7a34e4c79cb90bc5d2edd2bac024fee298b6a9d93d3a204acec7ba3e |