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.3.tar.gz
(85.8 kB
view hashes)
Built Distributions
Logbook-1.5.3-cp37-cp37m-win32.whl
(108.0 kB
view hashes)
Logbook-1.5.3-cp36-cp36m-win32.whl
(108.0 kB
view hashes)
Logbook-1.5.3-cp35-cp35m-win32.whl
(104.1 kB
view hashes)
Logbook-1.5.3-cp27-cp27m-win32.whl
(104.5 kB
view hashes)
Close
Hashes for Logbook-1.5.3-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0cf2cdbfb65a03b5987d19109dacad13417809dcf697f66e1a7084fb21744ea9 |
|
MD5 | a8b109e8a63199189eb0703e7c9e5b7f |
|
BLAKE2b-256 | cd841506b46b9f2925ad0bde0795a408827e83fe0c6b68cde230e5a393fc7d0f |
Close
Hashes for Logbook-1.5.3-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8f76a2e7b1f72595f753228732f81ce342caf03babc3fed6bbdcf366f2f20f18 |
|
MD5 | faa002e6b58ee75e91a18e082c827c38 |
|
BLAKE2b-256 | ac5ff98b9fff5ed1ba37da8ee5ef2aaa65218d96a72bd82f49a3ac5e279a9075 |
Close
Hashes for Logbook-1.5.3-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e18f7422214b1cf0240c56f884fd9c9b4ff9d0da2eabca9abccba56df7222f66 |
|
MD5 | 940eb697ddf62f5c70de6d24c8e83fb4 |
|
BLAKE2b-256 | 885b98b4c479955225362f922650b0cafe41bae774cbfbad6f93213cd947cd0f |
Close
Hashes for Logbook-1.5.3-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7c533eb728b3d220b1b5414ba4635292d149d79f74f6973b4aa744c850ca944a |
|
MD5 | d294e3c2d103719cbddce7a634d63f0b |
|
BLAKE2b-256 | 5faa13f5570e4e291e28ad1d9a9291433e1908dcb81e0bc2ce61cd9ae4a921a0 |
Close
Hashes for Logbook-1.5.3-cp35-cp35m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 97fee1bd9605f76335b169430ed65e15e457a844b2121bd1d90a08cf7e30aba0 |
|
MD5 | a8f6ab38a445a12d87a4e6c3bf932b19 |
|
BLAKE2b-256 | 82390b6b4222913511d35933fe8835e38a9a927a02b1945d9ef2afc3f00aee60 |
Close
Hashes for Logbook-1.5.3-cp35-cp35m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 94e2e11ff3c2304b0d09a36c6208e5ae756eb948b210e5cbd63cd8d27f911542 |
|
MD5 | 73d8191b3c48b832da4913bb9f790158 |
|
BLAKE2b-256 | 5f3ebd8d7100ff7575607a333ae0ab07912389b24cdf56d6b472668f987d4a62 |
Close
Hashes for Logbook-1.5.3-cp27-cp27m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2dc85f1510533fddb481e97677bb7bca913560862734c0b3b289bfed04f78c92 |
|
MD5 | dd05b5929b35365536517eb81b35cde1 |
|
BLAKE2b-256 | e0f0310f15baadca036f4789fe5049f907f6cde37bcc2cf3321b611352f1396b |
Close
Hashes for Logbook-1.5.3-cp27-cp27m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 56ee54c11df3377314cedcd6507638f015b4b88c0238c2e01b5eb44fd3a6ad1b |
|
MD5 | bf0edc2c9bf0d8d7d5c87cb07c83b459 |
|
BLAKE2b-256 | 04611e9e05146da1d5bab629e173ba10513e0437e6be0794c83902cfbcd16dbe |