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.4.tar.gz
(166.0 kB
view hashes)
Built Distributions
Logbook-0.12.4-py3.5-linux-x86_64.egg
(282.6 kB
view hashes)
Logbook-0.12.4-py3.4-linux-x86_64.egg
(282.8 kB
view hashes)
Logbook-0.12.4-py3.3-linux-x86_64.egg
(271.8 kB
view hashes)
Logbook-0.12.4-py3.2-linux-x86_64.egg
(267.6 kB
view hashes)
Logbook-0.12.4-py2.7-linux-x86_64.egg
(258.4 kB
view hashes)
Logbook-0.12.4-py2.6-linux-x86_64.egg
(258.0 kB
view hashes)
Close
Hashes for Logbook-0.12.4-py3.5-linux-x86_64.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 629d578622001671dcaf4f3fb2dd785f20219382543c3a655dee137b284b0d87 |
|
MD5 | 4be51269da80738f4dee95365f989868 |
|
BLAKE2b-256 | b989e7287a40e85c7775c4893bcd6f1d3238a7fdde9b73bf4f059e5c4dc222b3 |
Close
Hashes for Logbook-0.12.4-py3.4-linux-x86_64.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 346cdfabf4d87852623d77287ef8a2b352a127283e8399217c3ba3e3edfa35b8 |
|
MD5 | 1deafc3de43c00e2cc0228fa469fa48a |
|
BLAKE2b-256 | ebb89d4c5eef87dd0e4aa78f6ef33aca49c5d14ef456a877ba37eae8f56f6829 |
Close
Hashes for Logbook-0.12.4-py3.3-linux-x86_64.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 64097e62589709167ce70f8e949d5966e9d2c11e5d0d0e3632ae7232bbf63031 |
|
MD5 | a083825ee4456a554a507a379c209220 |
|
BLAKE2b-256 | 5b16e9ea579bc2532fc18db3b30c8783212bef1da837b2e5548906e62ba2fc26 |
Close
Hashes for Logbook-0.12.4-py3.2-linux-x86_64.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | cd64a26c9d6ee632adc3dbf66393ab5a3bc69ecbbd729940108746e1a1504911 |
|
MD5 | 8189575a78ed8b3cb95d9e393ae949a9 |
|
BLAKE2b-256 | 5f83283fcdefd07aaa22bd3cb479db1f13cecc6986195535ff9096c6b02d1ceb |
Close
Hashes for Logbook-0.12.4-py2.7-linux-x86_64.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | c915505a51df55843b6dc9da7866f85078b625f9e7783de131d6a7b248e61e45 |
|
MD5 | 013b9bd72e3465571a0edf699e60dcad |
|
BLAKE2b-256 | 1595784e455b196c19130e9b92f13d6221f0dc09b9f4e7b33a5869b13591232f |
Close
Hashes for Logbook-0.12.4-py2.6-linux-x86_64.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 924c2345f174fb46c8f940390f95f8f23d6e9575585844ffbfbcd221aeccbc54 |
|
MD5 | 0c4a50b6f3a78e70b9ca31fd2844e1e5 |
|
BLAKE2b-256 | 3ab56c0932b5e0fdb7dbe499e998d5dd7ead471f189d46457fea0eceae40d250 |
Close
Hashes for Logbook-0.12.4-cp35-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8837facfb4477494c0c13510022ecedca3e3aea0cd492baa8555097ef5bc350f |
|
MD5 | 2fe1fc251f8ddc3ac195160b175a6452 |
|
BLAKE2b-256 | cb8bfcbfb7e74c6fa4741bc789f649437a32ff14af31769fe3518bc8a2a28e06 |
Close
Hashes for Logbook-0.12.4-cp35-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e6a564cf4de0f17b73db14a3606dcd7e886a0ed83045eee71dda05e32b22eae3 |
|
MD5 | 7f49dd8dcef99c48c99b0afbe47def24 |
|
BLAKE2b-256 | 20144495c755167b54d2c4e0b303b8b6961de48d6a57c9a01a58a288b1b48f79 |
Close
Hashes for Logbook-0.12.4-cp34-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d5e9d5b64996094cf38f9f80aa34451ab59749378f4f0c869f2a45d712b64583 |
|
MD5 | f043f3f70a921cc25c5456e91e8af658 |
|
BLAKE2b-256 | 1e31b8779763c9b174b692de6e27b7dc889b9faf0e6203292879c467b33588e4 |
Close
Hashes for Logbook-0.12.4-cp34-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f9146ebc75b24113ac97f09a6ba728134de68d2bb5734cbbc977f02feb9b5ca5 |
|
MD5 | 3d59e13372a7e794f192dc922ecbeb68 |
|
BLAKE2b-256 | 17fd8b0bc7d19de87ef0991c54c310da9c9893a89c70eb664c4fd9d5aa4e5268 |
Close
Hashes for Logbook-0.12.4-cp33-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4e589de0d1e137998860e5b101d2de2c6acadf5b0f473ff4e924fea65e366f72 |
|
MD5 | 3847a942b6819e4f6deade252da786f5 |
|
BLAKE2b-256 | 56e300485fd62ceb0c034b2351f279338e48613599bcaeb2151a86cb76b09269 |
Close
Hashes for Logbook-0.12.4-cp33-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 244709c39c9804daeffeb2dc4b3b2b062b66dfd5128e610e69d091b0fcb6ccb4 |
|
MD5 | e3be1cd1c0b4baf3dc0318c5f96a253a |
|
BLAKE2b-256 | aa5f644944c2538975ce60da08cf8a64d8f06326251192801ab428b79428684c |
Close
Hashes for Logbook-0.12.4-cp32-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 942b3713ad71d546c6e0515981a4e21db42d3a1a811c55cb940bb6b0816910a1 |
|
MD5 | 023f145333204c8903484f2ba405a786 |
|
BLAKE2b-256 | 6d9093409a6d8716d1a3e277b40a1dfa4436a69250a368dfb5f02c5f878041a2 |
Close
Hashes for Logbook-0.12.4-cp32-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 65332307eb0e5ea5eb50f144d92db0afaaefca729c6e0c684bc6163a49744cc8 |
|
MD5 | 8935595bb404b6aa8cd64f2190a80064 |
|
BLAKE2b-256 | c26a27b9a0b24047551b61c3210682b526a848f4a07b55a2ab11e7ed4a6b7a94 |
Close
Hashes for Logbook-0.12.4-cp27-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f79a3834ba5b1def146ab1d1caf3e2532ce810742c6aa23f7b35dfc389d4cd9b |
|
MD5 | cf96f25d8bc85a6e7fcc442f9e36a4f2 |
|
BLAKE2b-256 | f4322297888053b163375d8448b9b0aff0b4c0ed268dcdc5cbec704df55c43d9 |
Close
Hashes for Logbook-0.12.4-cp27-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 92b7a67b5d5582b2a15ee47debf55fd9a86714f58b31f5d7bdbd58d35b608cc8 |
|
MD5 | 78cc6cf34ba3bc55502225db5a32c013 |
|
BLAKE2b-256 | c27feefc7736fa87c297ede87d0023af989bd0c0fbc595433d7c028a7d5c2396 |
Close
Hashes for Logbook-0.12.4-cp26-none-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6f5a543b50b4330d4e675a3a1daa804f3e012e30132e25d2a03c38c56eb9c48a |
|
MD5 | f67e33b3d1ceace899d9405e646c0520 |
|
BLAKE2b-256 | 8c8d92de23d631cd8fc5ae2dd923de72e488dda2e93f82361d537fd5c5d68bc9 |
Close
Hashes for Logbook-0.12.4-cp26-none-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | e08b20853022846d05a33a11768dfb4c9ae1e211b45cde685cea5dfefd644052 |
|
MD5 | 8b80725e2054a3ad15a249d7ff95f45c |
|
BLAKE2b-256 | 5c36917b262949f92d1196a3e5a4f05f6ed4dc0fbe7977c6cb03d8a300f84f9d |