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-0.12.3.tar.gz
(164.4 kB
view hashes)
Built Distributions
Close
Hashes for Logbook-0.12.3-cp35-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b5e267283252a5478e70bdec1e8dce1a42b45c2a9c22a16a6fed3198609f92d3 |
|
MD5 | 519fa38b3312db6b2559e3dc9e401541 |
|
BLAKE2b-256 | e28f9cdb5fe54b3267c6e967d2375c6182a0074a7bd68f94556653b68f72b83f |
Close
Hashes for Logbook-0.12.3-cp35-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bee731d2e8a604fe199c593be893d65aaa0609a891ab6d8cd3e839b921df84f4 |
|
MD5 | 2e4556d3a8e15048a401b95b730101b6 |
|
BLAKE2b-256 | e7b0087f02069628fef462bfda217ea1068041bb40feb61c0264b755a51aeec6 |
Close
Hashes for Logbook-0.12.3-cp34-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b45635116b18c2b546f3a8c80694f6707fa70daf36f9e0cd9c9487a9536a1e78 |
|
MD5 | 05cbb73d262071fb8cb168ea6c46bf9e |
|
BLAKE2b-256 | cf7134a5e112b69d6f10e454bf386b31a803e341602cb9b7c534543f2f0126f1 |
Close
Hashes for Logbook-0.12.3-cp34-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7c7a2e84995b75991aea8aa57d74e4fdf0eabbc1fb21d45a0f8fe5aa21e7a84e |
|
MD5 | aba56122d5b67d04faa07c416bfc0549 |
|
BLAKE2b-256 | a3d079c48ebc1e90d8af497e3a57ac48099d5479dff5e98bf256bf4ac5ce8aa8 |
Close
Hashes for Logbook-0.12.3-cp33-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ef008bbd268e2a21d5a84dcda8a98248f09d39923b0cd3da702cf17b6164a41d |
|
MD5 | ab1102d80d18db49daa75c8ea7bd8952 |
|
BLAKE2b-256 | d09bbb8fe7381edb171358038355db8ab97536fb51d837f75ba79ceda1a40da9 |
Close
Hashes for Logbook-0.12.3-cp33-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bcafeb49e0dca38536e5b255fbe872057389f09e489429d2b9c632490fda27b2 |
|
MD5 | aaa3ed0cd41d513b355e9063dde83c5a |
|
BLAKE2b-256 | c52048bddca0a62964784737ccc7a367056dbf9f64ff49c758997edb767073e9 |
Close
Hashes for Logbook-0.12.3-cp27-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c793e27823cadf83cf2960b97a3f17c99c360953072236f9177080a4b9d1e890 |
|
MD5 | c76372ece49a148242d0fa33c818fa95 |
|
BLAKE2b-256 | 6cc66d73180fb222e43a9416eaf24ec8add67703f9f8afc7f43ee2ea7e9c53dc |
Close
Hashes for Logbook-0.12.3-cp27-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c7af0e2237398069e94aa8b70757b8e7ef1acf80bbd4fcabb37cbf2217e62a87 |
|
MD5 | 5621ee7ce686320c9f8d7ae0b0286285 |
|
BLAKE2b-256 | 770ecfeb66e37994c2b064651d0ff09059f30bd9596610d69f4c10001af0ea8f |
Close
Hashes for Logbook-0.12.3-cp26-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 94c4d2901d9bd47ca4e04ff6cc33d40e8b2a829610f528d59448010ffd57e6ee |
|
MD5 | b973c15f2a8fe7b1196f961a825e4ec2 |
|
BLAKE2b-256 | 8c24dfd6c149abf9cbdf4fab3b7f43d19caecdb4737fcf4729091cc06dc69578 |
Close
Hashes for Logbook-0.12.3-cp26-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 97799b26a1e7bc1c08bc86bc8d576cafb16f02fb2df0562534c23b88f99e9c4b |
|
MD5 | 5943abe10758a59ec872425509b676fd |
|
BLAKE2b-256 | 6579748bdfaae8f81910bac67a0009d7fce4287a2e608c73f7ab780323053582 |