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.1.0.tar.gz
(186.7 kB
view hashes)
Built Distributions
Close
Hashes for Logbook-1.1.0-cp36-cp36m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9f68a6f87234798417130efab7e190ee5dc7e8ced500f82cd200bfa15e9b6987 |
|
MD5 | 7e1158f28525fd921428b8b9ecaedcb7 |
|
BLAKE2b-256 | bd988c12e8ba83d03dd4325032d64e6b35a8d19e0d8f681055dc387a7eae7b6e |
Close
Hashes for Logbook-1.1.0-cp36-cp36m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ef1397e6e82d8cbe3667c743f46144ccb252eca3173e4fc78e3afbe500e61c17 |
|
MD5 | e430bde4225c19f8f45fc9dd235d7bb0 |
|
BLAKE2b-256 | 236e2a195223d8a3b0c80c24dfac4a489cdbfbf009d386c20b9c7bcaff58a6d9 |
Close
Hashes for Logbook-1.1.0-cp35-cp35m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1ac26372b97a9d93be13968a30bcc110610960b688c5164a2890a75b3ad6668f |
|
MD5 | 61e417e830a1e09cfcb49fc6330f485c |
|
BLAKE2b-256 | 6c66f06b8e8d1acaa4bb36540bea0bc3ecb42b3741168f3eff1e94cedd694111 |
Close
Hashes for Logbook-1.1.0-cp35-cp35m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 66d8cf296edbb64a68a47762f2cf78da7d70690c0a54ce7fbdeec1325db3306e |
|
MD5 | 1368c71f3b6a99dca95767f349996283 |
|
BLAKE2b-256 | cc7280557b5754e48f6baf63d03358d7848c35f3efcd7b0bc613f24b7104508a |
Close
Hashes for Logbook-1.1.0-cp34-cp34m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9615ff1c55fe7632d6909eb01b97d64b323077323f1a5d6e4b657180e0bc1e6e |
|
MD5 | 9b106323bd18af22c7718272a6d65c13 |
|
BLAKE2b-256 | 211ad2812b126faff53fbd5f17e8fcf3faf07bb1598935d1df5367cc1a4dd3ab |
Close
Hashes for Logbook-1.1.0-cp34-cp34m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | dcd4a2fa711a5fb4fa9792629ca3c2c3d03ead50c8c181371352bb273a0ab3a9 |
|
MD5 | 52024955e9fb4da48389dd62cb4ab263 |
|
BLAKE2b-256 | c7f87beb89c760225033aacca5166eaa1b1a910ed1f8dd05fbeea79e0f713f29 |
Close
Hashes for Logbook-1.1.0-cp33-cp33m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b42b6dd6caf9fa9ed69d074659584aaa36f2617ddc1217bfb25c8a3f77e109e8 |
|
MD5 | 4b94c5ee2910262a54d95c56960c4d2a |
|
BLAKE2b-256 | ecdce9f845a358ef45dd4d55382a9d68ecf9c97d030ad58e4ee1a61dca523bbf |
Close
Hashes for Logbook-1.1.0-cp33-cp33m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 49b39ff2db6950a8e8bed2ae21e4418ee89d7a2d13b6b687ef346a9d39a517a8 |
|
MD5 | 993b5d54f3b929df630f7d6677413e26 |
|
BLAKE2b-256 | ed740e2cf705dce1292b719bb64b604a4d50983eb3a9ae7bb4fc2280570de0ce |
Close
Hashes for Logbook-1.1.0-cp27-cp27m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 82206c17d08cb5aa47655b51f735b6dd5a62543c13154bdca8eb6fc5d720022e |
|
MD5 | 3d6a67bb1de66817f6087d561be1557a |
|
BLAKE2b-256 | 05d5f6abad76d4c12c4f7a3ca93fd90e0453162d0c26b8c23d94719e758c0fff |
Close
Hashes for Logbook-1.1.0-cp27-cp27m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f37048f33600bb836b4a840cedb216ee52417d98d47f80a237669841310a4d6f |
|
MD5 | 59502bd69e7411eb7593913d81a79417 |
|
BLAKE2b-256 | f93a5bddfb5a24b68fabc60bdd0eff8f028b0e7f26416cbe486c1770571df1d8 |