{"id":13501302,"url":"https://github.com/microsoft/picologging","last_synced_at":"2025-04-11T03:29:58.215Z","repository":{"id":37629427,"uuid":"501964825","full_name":"microsoft/picologging","owner":"microsoft","description":"An optimized logging library for Python","archived":false,"fork":false,"pushed_at":"2024-11-25T00:54:54.000Z","size":757,"stargazers_count":701,"open_issues_count":42,"forks_count":24,"subscribers_count":8,"default_branch":"main","last_synced_at":"2025-04-03T19:59:34.929Z","etag":null,"topics":["hacktoberfest","logging","python"],"latest_commit_sha":null,"homepage":"https://microsoft.github.io/picologging","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/microsoft.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":"SUPPORT.md","governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-06-10T08:35:51.000Z","updated_at":"2025-04-01T21:24:35.000Z","dependencies_parsed_at":"2023-02-08T05:46:15.410Z","dependency_job_id":"ba99fde6-3d50-46c4-8a27-74edad4f132e","html_url":"https://github.com/microsoft/picologging","commit_stats":{"total_commits":482,"total_committers":13,"mean_commits":37.07692307692308,"dds":"0.31950207468879666","last_synced_commit":"dc110b52c9f2e209f97a6fe80d286afb73a8437e"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2Fpicologging","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2Fpicologging/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2Fpicologging/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/microsoft%2Fpicologging/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/microsoft","download_url":"https://codeload.github.com/microsoft/picologging/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248335281,"owners_count":21086548,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["hacktoberfest","logging","python"],"created_at":"2024-07-31T22:01:32.331Z","updated_at":"2025-04-11T03:29:58.195Z","avatar_url":"https://github.com/microsoft.png","language":"Python","readme":"# picologging\n\n[![PyPI - Python Version](https://img.shields.io/pypi/pyversions/picologging)](https://pypi.org/project/picologging/)\n[![PyPI](https://img.shields.io/pypi/v/picologging)](https://pypi.org/project/picologging/)\n[![Anaconda-Server Badge](https://anaconda.org/conda-forge/picologging/badges/version.svg)](https://anaconda.org/conda-forge/picologging)\n[![codecov](https://codecov.io/gh/microsoft/picologging/branch/main/graph/badge.svg?token=KHs6FpQlVW)](https://codecov.io/gh/microsoft/picologging)\n\n\u003e **Warning**\n\u003e This project is in *beta*.\n\u003e There are some incomplete features (see [Limitations](https://microsoft.github.io/picologging/limitations.html)).\n\nPicologging is a high-performance logging library for Python. picologging is 4-17x faster than the `logging` module in the standard library.\n\nPicologging 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.\n\nCheck out the [Documentation](https://microsoft.github.io/picologging/) for more.\n\n## Installation\n\nPicologging can be installed from PyPi using pip:\n\n```console\npip install picologging\n```\n\nOr from conda forge using conda:\n\n```console\nconda install -c conda-forge picologging\n```\n\n## Usage\n\nImport `picologging as logging` to use picologging instead of the standard library logging module.\n\nThis patches all the loggers registered to use picologging loggers and formatters.\n\n```python\nimport picologging as logging\nlogging.basicConfig()\n\nlogger = logging.getLogger()\n\nlogger.info(\"A log message!\")\n\nlogger.warning(\"A log message with %s\", \"arguments\")\n```\n\n## Benchmarks\n\nRun `richbench benchmarks/ --markdown` with the richbench CLI to see the benchmarks, here is a sample on macOS 11:\n\n|                             Benchmark | Min     | Max     | Mean    | Min (+)         | Max (+)         | Mean (+)        |\n|---------------------------------------|---------|---------|---------|-----------------|-----------------|-----------------|\n|           Logger(level=DEBUG).debug() | 0.569   | 0.600   | 0.578   | 0.031 (18.3x)   | 0.035 (17.0x)   | 0.033 (17.7x)   |\n| Logger(level=DEBUG).debug() with args | 0.591   | 0.607   | 0.601   | 0.047 (12.5x)   | 0.050 (12.2x)   | 0.048 (12.4x)   |\n|            Logger(level=INFO).debug() | 0.013   | 0.014   | 0.013   | 0.003 (5.0x)    | 0.003 (4.4x)    | 0.003 (4.8x)    |\n|  Logger(level=INFO).debug() with args | 0.013   | 0.014   | 0.013   | 0.003 (4.6x)    | 0.003 (4.2x)    | 0.003 (4.4x)    |\n\n## Limitations\n\nSee [Limitations](https://microsoft.github.io/picologging/limitations.html)\n\n## Contributing\n\nThis project welcomes contributions and suggestions.  Most contributions require you to agree to a\nContributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us\nthe rights to use your contribution. For details, visit [cla.opensource.microsoft.com](https://cla.opensource.microsoft.com).\n\nWhen you submit a pull request, a CLA bot will automatically determine whether you need to provide\na CLA and decorate the PR appropriately (e.g., status check, comment). Simply follow the instructions\nprovided by the bot. You will only need to do this once across all repos using our CLA.\n\nThis project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/).\nFor more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or\ncontact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any additional questions or comments.\n\n## Local development\n\nThis project comes bundled with a dev container which sets up an appropriate environment. If you install the Dev Containers extension for VS Code, then opening this project in VS Code should prompt it to open it in the dev container.\n\nOnce opened in the dev container, run:\n\n```console\npip install -e \".[dev]\"\npre-commit install\npython setup.py build_ext --inplace --build-type Debug\n```\n\nRun the build command whenever you make changes to the files.\n\nIt's also helpful to create a `.vscode/launch.json` file like this one:\n\n```json\n{\n    \"version\": \"0.2.0\",\n    \"configurations\": [\n    {\n        \"name\": \"(gdb) Launch pytest\",\n        \"type\": \"cppdbg\",\n        \"request\": \"launch\",\n        \"program\": \"/usr/local/bin/python\",\n        \"args\": [\"-m\", \"pytest\", \"tests\"],\n        \"stopAtEntry\": false,\n        \"cwd\": \"${workspaceFolder}\",\n        \"environment\": [],\n        \"externalConsole\": false,\n        \"MIMode\": \"gdb\",\n        \"setupCommands\": [\n            {\n                \"description\": \"Enable pretty-printing for gdb\",\n                \"text\": \"-enable-pretty-printing\",\n                \"ignoreFailures\": true\n            },\n            {\n                \"description\":  \"Set Disassembly Flavor to Intel\",\n                \"text\": \"-gdb-set disassembly-flavor intel\",\n                \"ignoreFailures\": true\n            },\n        ]\n    }\n}\n```\n\nNow you can press the \"Run and debug\" button to run `pytest` from the `gdb` debugger\nand use breakpoint debugging in the C code.\n\nIf you would like to be able to dive into the CPython code while debugging, then:\n\n1. Do a git checkout of the tagged branch for the devcontainer's Python version\ninto the devcontainer's `/workspaces/` directory. You may need to `sudo`.\n2. Follow the instructions in the CPython README to compile the code.\n3. Add the following key to the the configuration in `launch.json`:\n\n    ```json\n    \"sourceFileMap\": { \"/usr/src/python\": \"/workspaces/cpython\" },\n    ```\n\n4. Add the following command to the `setupCommands` in `launch.json`:\n\n    ```json\n    {\n        \"description\": \"Find CPython source code\",\n        \"text\": \"-gdb-set auto-load safe-path /workspaces/cpython\"\n    },\n    ```\n\n## Trademarks\n\nSome components of this Python package are from CPython 3.11 logging library for compatibility reasons.\n\nCPython 3.11 is licensed under the PSF license.\nThe logging module is Copyright (C) 2001-2019 Vinay Sajip. All Rights Reserved.\n\nThis 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 \u0026 Brand Guidelines](https://www.microsoft.com/en-us/legal/intellectualproperty/trademarks/usage/general).\nUse of Microsoft trademarks or logos in modified versions of this project must not cause confusion or imply Microsoft sponsorship.\nAny use of third-party trademarks or logos are subject to those third-party's policies.\n","funding_links":[],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrosoft%2Fpicologging","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmicrosoft%2Fpicologging","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmicrosoft%2Fpicologging/lists"}