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.
Metadata
Release files for Logbook 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| Logbook-1.1.0.tar.gz | 186.7 kB | Details |
Built distributions (wheels)
| File | Reset | |||
|---|---|---|---|---|
| Logbook-1.1.0-cp36-cp36m-win_amd64.whl | CPython 3.6 | CPython 3.6 pymalloc | Windows x86-64 | Details |
| Logbook-1.1.0-cp36-cp36m-win32.whl | CPython 3.6 | CPython 3.6 pymalloc | Windows x86-32 | Details |
| Logbook-1.1.0-cp35-cp35m-win_amd64.whl | CPython 3.5 | CPython 3.5 pymalloc | Windows x86-64 | Details |
| Logbook-1.1.0-cp35-cp35m-win32.whl | CPython 3.5 | CPython 3.5 pymalloc | Windows x86-32 | Details |
| Logbook-1.1.0-cp34-cp34m-win_amd64.whl | CPython 3.4 | CPython 3.4 pymalloc | Windows x86-64 | Details |
| Logbook-1.1.0-cp34-cp34m-win32.whl | CPython 3.4 | CPython 3.4 pymalloc | Windows x86-32 | Details |
| Logbook-1.1.0-cp33-cp33m-win_amd64.whl | CPython 3.3 | CPython 3.3 pymalloc | Windows x86-64 | Details |
| Logbook-1.1.0-cp33-cp33m-win32.whl | CPython 3.3 | CPython 3.3 pymalloc | Windows x86-32 | Details |
| Logbook-1.1.0-cp27-cp27m-win_amd64.whl | CPython 2.7 | CPython 2.7 pymalloc | Windows x86-64 | Details |
| Logbook-1.1.0-cp27-cp27m-win32.whl | CPython 2.7 | CPython 2.7 pymalloc | Windows x86-32 | Details |
Total release size: 1.1 MB
Release files / Logbook-1.1.0.tar.gz
| Download URL | Logbook-1.1.0.tar.gz |
|---|---|
| Size | 186.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
0e37a18f4f8244b02a1c44cfd2a3bab9513e6e22b67986ab6a91d52b87f0940b
|
|
BLAKE2b-256 checksum How to use checksums |
a2d1b5d12094f5a5b8f456198991c44b56faf72411e58dc166e71593ff2febea
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / Logbook-1.1.0-cp36-cp36m-win_amd64.whl
| Download URL | Logbook-1.1.0-cp36-cp36m-win_amd64.whl |
|---|---|
| Size | 96.6 kB |
| Tags | CPython 3.6 CPython 3.6 pymalloc Windows x86-64 |
|
SHA-256 checksum How to use checksums |
9f68a6f87234798417130efab7e190ee5dc7e8ced500f82cd200bfa15e9b6987
|
|
BLAKE2b-256 checksum How to use checksums |
bd988c12e8ba83d03dd4325032d64e6b35a8d19e0d8f681055dc387a7eae7b6e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / Logbook-1.1.0-cp36-cp36m-win32.whl
| Download URL | Logbook-1.1.0-cp36-cp36m-win32.whl |
|---|---|
| Size | 91.7 kB |
| Tags | CPython 3.6 CPython 3.6 pymalloc Windows x86-32 |
|
SHA-256 checksum How to use checksums |
ef1397e6e82d8cbe3667c743f46144ccb252eca3173e4fc78e3afbe500e61c17
|
|
BLAKE2b-256 checksum How to use checksums |
236e2a195223d8a3b0c80c24dfac4a489cdbfbf009d386c20b9c7bcaff58a6d9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / Logbook-1.1.0-cp35-cp35m-win_amd64.whl
| Download URL | Logbook-1.1.0-cp35-cp35m-win_amd64.whl |
|---|---|
| Size | 96.6 kB |
| Tags | CPython 3.5 CPython 3.5 pymalloc Windows x86-64 |
|
SHA-256 checksum How to use checksums |
1ac26372b97a9d93be13968a30bcc110610960b688c5164a2890a75b3ad6668f
|
|
BLAKE2b-256 checksum How to use checksums |
6c66f06b8e8d1acaa4bb36540bea0bc3ecb42b3741168f3eff1e94cedd694111
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / Logbook-1.1.0-cp35-cp35m-win32.whl
| Download URL | Logbook-1.1.0-cp35-cp35m-win32.whl |
|---|---|
| Size | 91.3 kB |
| Tags | CPython 3.5 CPython 3.5 pymalloc Windows x86-32 |
|
SHA-256 checksum How to use checksums |
66d8cf296edbb64a68a47762f2cf78da7d70690c0a54ce7fbdeec1325db3306e
|
|
BLAKE2b-256 checksum How to use checksums |
cc7280557b5754e48f6baf63d03358d7848c35f3efcd7b0bc613f24b7104508a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / Logbook-1.1.0-cp34-cp34m-win_amd64.whl
| Download URL | Logbook-1.1.0-cp34-cp34m-win_amd64.whl |
|---|---|
| Size | 94.9 kB |
| Tags | CPython 3.4 CPython 3.4 pymalloc Windows x86-64 |
|
SHA-256 checksum How to use checksums |
9615ff1c55fe7632d6909eb01b97d64b323077323f1a5d6e4b657180e0bc1e6e
|
|
BLAKE2b-256 checksum How to use checksums |
211ad2812b126faff53fbd5f17e8fcf3faf07bb1598935d1df5367cc1a4dd3ab
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / Logbook-1.1.0-cp34-cp34m-win32.whl
| Download URL | Logbook-1.1.0-cp34-cp34m-win32.whl |
|---|---|
| Size | 91.5 kB |
| Tags | CPython 3.4 CPython 3.4 pymalloc Windows x86-32 |
|
SHA-256 checksum How to use checksums |
dcd4a2fa711a5fb4fa9792629ca3c2c3d03ead50c8c181371352bb273a0ab3a9
|
|
BLAKE2b-256 checksum How to use checksums |
c7f87beb89c760225033aacca5166eaa1b1a910ed1f8dd05fbeea79e0f713f29
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / Logbook-1.1.0-cp33-cp33m-win_amd64.whl
| Download URL | Logbook-1.1.0-cp33-cp33m-win_amd64.whl |
|---|---|
| Size | 94.9 kB |
| Tags | CPython 3.3 CPython 3.3 pymalloc Windows x86-64 |
|
SHA-256 checksum How to use checksums |
b42b6dd6caf9fa9ed69d074659584aaa36f2617ddc1217bfb25c8a3f77e109e8
|
|
BLAKE2b-256 checksum How to use checksums |
ecdce9f845a358ef45dd4d55382a9d68ecf9c97d030ad58e4ee1a61dca523bbf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / Logbook-1.1.0-cp33-cp33m-win32.whl
| Download URL | Logbook-1.1.0-cp33-cp33m-win32.whl |
|---|---|
| Size | 91.4 kB |
| Tags | CPython 3.3 CPython 3.3 pymalloc Windows x86-32 |
|
SHA-256 checksum How to use checksums |
49b39ff2db6950a8e8bed2ae21e4418ee89d7a2d13b6b687ef346a9d39a517a8
|
|
BLAKE2b-256 checksum How to use checksums |
ed740e2cf705dce1292b719bb64b604a4d50983eb3a9ae7bb4fc2280570de0ce
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / Logbook-1.1.0-cp27-cp27m-win_amd64.whl
| Download URL | Logbook-1.1.0-cp27-cp27m-win_amd64.whl |
|---|---|
| Size | 94.0 kB |
| Tags | CPython 2.7 CPython 2.7 pymalloc Windows x86-64 |
|
SHA-256 checksum How to use checksums |
82206c17d08cb5aa47655b51f735b6dd5a62543c13154bdca8eb6fc5d720022e
|
|
BLAKE2b-256 checksum How to use checksums |
05d5f6abad76d4c12c4f7a3ca93fd90e0453162d0c26b8c23d94719e758c0fff
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Release files / Logbook-1.1.0-cp27-cp27m-win32.whl
| Download URL | Logbook-1.1.0-cp27-cp27m-win32.whl |
|---|---|
| Size | 91.2 kB |
| Tags | CPython 2.7 CPython 2.7 pymalloc Windows x86-32 |
|
SHA-256 checksum How to use checksums |
f37048f33600bb836b4a840cedb216ee52417d98d47f80a237669841310a4d6f
|
|
BLAKE2b-256 checksum How to use checksums |
f93a5bddfb5a24b68fabc60bdd0eff8f028b0e7f26416cbe486c1770571df1d8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |