A fast and lightweight logging library for Python
Project description
picologging
Status This project is an early-alpha. There are some incomplete features (see Issues).
Picologging is a high-performance logging library for Python. picologging is 4-10x faster than the logging
module in the standard library.
Picologging is designed to be used as a drop-in replacement for applications which already use logging, and supports the same API as the logging
module.
Check out the Documentation for more.
Installation
$ pip install picologging
Usage
Import picologging as logging
to use picologging instead of the standard library logging module.
This patches all the loggers registered to use picologging loggers and formatters.
import picologging as logging
logging.basicConfig()
logger = logging.getLogger()
logger.info("A log message!")
logger.warning("A log message with %s", "arguments")
Benchmarks
Run richbench benchmarks/ --markdown
with the richbench CLI to see the benchmarks, here is a sample on macOS 11:
Benchmark | Min | Max | Mean | Min (+) | Max (+) | Mean (+) |
---|---|---|---|---|---|---|
FileHandler() | 0.138 | 0.151 | 0.143 | 0.055 (2.5x) | 0.063 (2.4x) | 0.058 (2.5x) |
WatchedFileHandler() | 0.189 | 0.197 | 0.193 | 0.097 (1.9x) | 0.101 (1.9x) | 0.099 (1.9x) |
RotatingFileHandler() | 0.287 | 0.304 | 0.296 | 0.174 (1.6x) | 0.178 (1.7x) | 0.176 (1.7x) |
QueueHandler() | 1.109 | 1.195 | 1.130 | 0.142 (7.8x) | 0.151 (7.9x) | 0.147 (7.7x) |
QueueListener() + QueueHandler() | 0.157 | 0.167 | 0.162 | 0.034 (4.6x) | 0.039 (4.3x) | 0.037 (4.3x) |
MemoryHandler() | 0.126 | 0.144 | 0.133 | 0.051 (2.5x) | 0.059 (2.5x) | 0.054 (2.5x) |
LogRecord() | 0.225 | 0.248 | 0.233 | 0.026 (8.7x) | 0.029 (8.5x) | 0.028 (8.4x) |
Formatter().format() | 0.076 | 0.086 | 0.081 | 0.004 (18.7x) | 0.005 (18.9x) | 0.004 (19.1x) |
Formatter().format() with date | 0.298 | 0.311 | 0.304 | 0.081 (3.7x) | 0.087 (3.6x) | 0.084 (3.6x) |
Logger(level=DEBUG).debug() | 0.726 | 0.743 | 0.734 | 0.059 (12.3x) | 0.061 (12.3x) | 0.060 (12.3x) |
Logger(level=DEBUG).debug() with args | 0.761 | 0.809 | 0.777 | 0.081 (9.4x) | 0.087 (9.3x) | 0.084 (9.2x) |
Logger(level=INFO).debug() | 0.016 | 0.018 | 0.017 | 0.004 (4.3x) | 0.005 (3.8x) | 0.004 (4.1x) |
Logger(level=INFO).debug() with args | 0.018 | 0.019 | 0.018 | 0.005 (3.8x) | 0.005 (3.8x) | 0.005 (3.7x) |
Limitations
See Limitations
Contributing
This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.opensource.microsoft.com.
When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.
This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact opencode@microsoft.com with any additional questions or comments.
Trademarks
Some components of this Python package are from CPython 3.11 logging library for compatibility reasons.
CPython 3.11 is licensed under the PSF license. The logging module is Copyright (C) 2001-2019 Vinay Sajip. All Rights Reserved.
This project may contain trademarks or logos for projects, products, or services. Authorized use of Microsoft trademarks or logos is subject to and must follow Microsoft's Trademark & Brand Guidelines. Use of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship. Any use of third-party trademarks or logos are subject to those third-party's policies.
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
Built Distributions
Hashes for picologging-0.8.0-cp311-cp311-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7762ad37ea9cdb8d64223c013765d07641b21717b93db06d6001cb1ccebbb049 |
|
MD5 | cf55f78292b3b9e493d18e93c299f1ec |
|
BLAKE2b-256 | 25d6df056cbeecd4073ae1ff118d817fa09bdcdc2b617682d45976dbb73e1a04 |
Hashes for picologging-0.8.0-cp311-cp311-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 85ce399b3e3c5c192aa8c0aa16fbd4d6d2d765e7b7d2b84cdb22059101e465eb |
|
MD5 | c9a1d2ff988cb6de319ab44191632221 |
|
BLAKE2b-256 | 782386000e324a52fc19c5ec54ada6a9c7c47ba98ef572f780b906f0aa3b2ad3 |
Hashes for picologging-0.8.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ed36a5fea84cf2857b77e09c4145452266ea5181121d181606de21d55709babd |
|
MD5 | ac4410294e90fb263f68ef40eb975e38 |
|
BLAKE2b-256 | c8b67e51e47454d07d8fce353fe57c994386bd5086d0640b7453ad34c554f790 |
Hashes for picologging-0.8.0-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ccba8ea07513dafb4dad83c08f2cf426f961175c1d21763b0d1d18118ede93ae |
|
MD5 | 3e046ea5fc3381e5e62ba3fc29025d87 |
|
BLAKE2b-256 | 0a02a15cacf61de92eec6757ce4e5660c38bf0163d7c2da6692624a3a3b51004 |
Hashes for picologging-0.8.0-cp311-cp311-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | eddf10a77c53728eef644a0374e40c9604e5164645400dc0a0044d68060288e7 |
|
MD5 | 49e33915c255097cecf04b1be817383d |
|
BLAKE2b-256 | 92328d1f015f78e4ae2ac6051fa0bed64b70c61fed635a524daa35c9388e7ed6 |
Hashes for picologging-0.8.0-cp311-cp311-macosx_10_15_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8022dee9e598526530dcb687c5968139cf97fb6b2f59f995cc717709e88bf565 |
|
MD5 | 746a063735b3d7d8c349653888a71f16 |
|
BLAKE2b-256 | 417a857f2f470c2b5d18b7f6ad44b80dd4a3f2a120fb40d7b96ebc5c41fecb64 |
Hashes for picologging-0.8.0-cp310-cp310-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 620b6f470b3b9cfd1e4493de815e372deb0e422fee4a638929df81d20324c561 |
|
MD5 | 0c5ff9447388013b05b666904a5fb11e |
|
BLAKE2b-256 | 2aeb4992360be8dd93f6663a5b6e615fdc0235273175da54527358e7df05b6db |
Hashes for picologging-0.8.0-cp310-cp310-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b9700fb2b8069663560ccfef824ca969084190576dc4754e20b5c353c8b14465 |
|
MD5 | b8e58a4c992afc2f6d6c33decd7cf30b |
|
BLAKE2b-256 | a97647b9ffe5484980024518eb8f15c51163d080eb1e2d34677bf120a19f7208 |
Hashes for picologging-0.8.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d6f6c464c52cec53a77a1a242c29c2c7c67d7d0e6ea04aca62eea5081b4e7a68 |
|
MD5 | daf343ff75c685a021bd5c502f9e1631 |
|
BLAKE2b-256 | 2bef6b1e9cf23009614b967a33d226d27613ff483e9d6ab9dfce1badb374e7d4 |
Hashes for picologging-0.8.0-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 22abc53a3c8288efddcaddabdc1dc7605aef5782a7b02e22cfd442d137031a1c |
|
MD5 | 0b993569d2ec03ec3ad3594aec7f3166 |
|
BLAKE2b-256 | 36c9299930ebf2e64321c2caf88c8c902861d518b024e086a2e57656f8ef0b4c |
Hashes for picologging-0.8.0-cp310-cp310-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2192eacd6fc13a19ffd7401e471c8003acf2edb5f524e42445c749a439521190 |
|
MD5 | ae504f7a69d7b4839b44ec4e24c652ba |
|
BLAKE2b-256 | d71da1463848defd0ee6194b340a38747beb280d1d97c5dc6e707e07be8fb91f |
Hashes for picologging-0.8.0-cp310-cp310-macosx_10_15_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 39164a84064770ef8f1ac5a9f18392edcf5ddc1a5c3342c32761258a6ff3e3a2 |
|
MD5 | 9af85a8ab911313fb4ef9ba1125d280a |
|
BLAKE2b-256 | 7a1000ef21f4b26ffdb48e23c47a94121912ad6fe0e372661fd052978c043576 |
Hashes for picologging-0.8.0-cp39-cp39-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7994442e227f3100207bf7b07424858a7425e49f8ed1dd1840e606f5ff4980e3 |
|
MD5 | 8f944d57bfb5b7a2438b372b67ae0e4c |
|
BLAKE2b-256 | 28e20a247e3eb761c9493398dd8b158a6e5ecaeacd1a7f9a7bd591085f1ed8e4 |
Hashes for picologging-0.8.0-cp39-cp39-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 716d34e59d56399c4844d9dad4e100dd59b48b8f378747752c27532f9a119ed6 |
|
MD5 | 0fc7eb27273598581f048ac73d119792 |
|
BLAKE2b-256 | b3638162f4d656efef994653555a745bbf12a1674dcd17037f2025800d53bfe6 |
Hashes for picologging-0.8.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f0f5bdd08047aacf212e795341987924947ef611cb4d0420ae225199b650c50c |
|
MD5 | d1f1ca6d837194e794dbef92ae0bcb86 |
|
BLAKE2b-256 | 016861c4c16dae30e0ebf516369cd1a6df9d0109a93f739205b90d5b5452d499 |
Hashes for picologging-0.8.0-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0c0cdfdc6e2f8ca2f46eb00d4df65c99537f86b20110d3c4a0050e11fbd953a4 |
|
MD5 | b05c97bb06cab87e9a6dc948274667cc |
|
BLAKE2b-256 | aec61842ebbc8205e95b969d754a0917b999e97dab533a35cb6c6d7aba56c6e0 |
Hashes for picologging-0.8.0-cp39-cp39-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3fbf6684f92906e1d80aad7073e9670c9cfd0bcf25a728be64d80422a660beff |
|
MD5 | ee35f437a31894a9d70cf487a11c4ae5 |
|
BLAKE2b-256 | 888b4ccae0012ba5cadc29be802fa1ffa5f70961380378b23ed32310a629256a |
Hashes for picologging-0.8.0-cp39-cp39-macosx_10_15_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a742f892169f74a644f61cb93f3f2f1b6e558c0c115cda96f912c530d295205b |
|
MD5 | 8a0c35d33672b982abd2d5ee136df821 |
|
BLAKE2b-256 | 159970f44386dae9abec4b4397e9e78cc063c2e8a4fe0f72c1dfa23ef1043e18 |
Hashes for picologging-0.8.0-cp38-cp38-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ca91313224db5def29e3146a4b16f96b48aea8f5c81281945bc22e0de9915c14 |
|
MD5 | f1dc7bb262d4df551af25ef10799709f |
|
BLAKE2b-256 | 630743172d885a9dc6e5cda5200a2feb9fde2e9b1406f9eec502abf711a41310 |
Hashes for picologging-0.8.0-cp38-cp38-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f5c3e854d6e7272fc416e17ca455f6875fdd7c98a2a849903e7facacf72dddf |
|
MD5 | 65d9ba876e0874c511d3ff347a662f84 |
|
BLAKE2b-256 | 0cf2fa2ef55dc11dd18ae05c98e1db3cb590912f661bb995b1b17d0c03f0713a |
Hashes for picologging-0.8.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 18e9b834f70819c6a69cf6a4eaf1117777a7dc4a9b7425e1071bb827dca86ae3 |
|
MD5 | 3c82d416189f021a84d0598895e55479 |
|
BLAKE2b-256 | 51493a8df1ebfea27e0a90067a22daf7bacd2e93dfc3d4b5589e7cba74f00c68 |
Hashes for picologging-0.8.0-cp38-cp38-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8310f6d6721b918a242c0811d551d2a66beded43015ec3b5eff659e48af5e70c |
|
MD5 | 656bbf74228481e295711df4c6d022c6 |
|
BLAKE2b-256 | de25afddd97a7295114374d5f5ac269274e888188d8f133454f98970e86f8689 |
Hashes for picologging-0.8.0-cp38-cp38-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 0d0d28005fe274a9ab900f2196b564aa9de932374475e7baec273c7a2d3a4f27 |
|
MD5 | 4c044cca8a4162dd1ecdbf002354af9c |
|
BLAKE2b-256 | 6a1d6d834f5d8c8702c945a65da34c6279eed6214d2ab9ed29e3c59061265248 |
Hashes for picologging-0.8.0-cp38-cp38-macosx_10_15_universal2.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3b6e9e1f787f7c9e3fd45092ec321d07948ee1d16cc665e722b6ddae1f65ed54 |
|
MD5 | 3bfa0bcc51e6bb39b4187ecfb2e89268 |
|
BLAKE2b-256 | 7c9654b8f045d682e3ec0209885637c990db637eeffe2c6fc46565be4697639c |
Hashes for picologging-0.8.0-cp37-cp37m-win_amd64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8b3241059ae63a09c03dec3b32185e21da9128c2ad484ce77dbe72b124a698e8 |
|
MD5 | b7b9b6fe65df7cc08b11655c958b5897 |
|
BLAKE2b-256 | 09991daf156609eced79f76d0eef5da6c9e60a1ce07680a97f4c688d6e9a5b26 |
Hashes for picologging-0.8.0-cp37-cp37m-win32.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bfc184eb5337689b1183b090cb3f879a99654a6f7ad6472f50a84db23fc2bc15 |
|
MD5 | 0610008a7bb0348f4c81d0e868d742f8 |
|
BLAKE2b-256 | 769ee71d0ad5928bf24a0c28654dc86edba144c9f81f25dc3c115f737c3fd5a5 |
Hashes for picologging-0.8.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 72fdaf69b1f94a9e7c0abdefb47d8dd04767bfa76358ec75ef44f455b64224b2 |
|
MD5 | 98b3020767a18923d45fa8da7170a54d |
|
BLAKE2b-256 | 82f231525cba22ecabe134eab66b4136fa5598be8029881cd1738690c7f51153 |
Hashes for picologging-0.8.0-cp37-cp37m-manylinux_2_17_i686.manylinux2014_i686.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ec7b89297fbcffc53510021759910474246d2ac0cd1e034d664c31a2f8f7f074 |
|
MD5 | 05ee830246526811a42bfc666f084960 |
|
BLAKE2b-256 | f58eb53599ec131147832af9ec4cb891309c7fe493affbad55d49923fd31caf2 |
Hashes for picologging-0.8.0-cp37-cp37m-macosx_10_15_x86_64.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | bac496379a0a0c101a30ac7f498486bc5a7fc8968299e00456e5f10d3621eb79 |
|
MD5 | cb91c7b2cdce4ef3aadfa0cb5aaee2f4 |
|
BLAKE2b-256 | 01bf696315ffdbfff6fd1c5a870eb9d9ed9ffc98ec81ee782c5a97aa74a55316 |