{"id":13825820,"url":"https://github.com/vpoulailleau/simplelogging","last_synced_at":"2025-08-21T07:32:10.867Z","repository":{"id":33619995,"uuid":"160074276","full_name":"vpoulailleau/simplelogging","owner":"vpoulailleau","description":"Logging made easy, no excuse for any debug print call.","archived":false,"fork":false,"pushed_at":"2024-07-02T09:25:39.000Z","size":697,"stargazers_count":16,"open_issues_count":3,"forks_count":5,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-08-15T21:45:10.689Z","etag":null,"topics":["colorlog","debug","debugging","logger","logging","python","python3","simple"],"latest_commit_sha":null,"homepage":"https://simplelogging.readthedocs.io","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vpoulailleau.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.rst","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":"AUTHORS.rst","dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-12-02T17:55:05.000Z","updated_at":"2025-04-09T10:13:37.000Z","dependencies_parsed_at":"2024-05-29T22:52:29.130Z","dependency_job_id":"e958a39a-76f8-4a44-a994-f0ff6115c143","html_url":"https://github.com/vpoulailleau/simplelogging","commit_stats":{"total_commits":268,"total_committers":6,"mean_commits":"44.666666666666664","dds":0.5223880597014925,"last_synced_commit":"20f2d66b1725b1daf2d7d96e76a13b7360ddffd3"},"previous_names":[],"tags_count":11,"template":false,"template_full_name":null,"purl":"pkg:github/vpoulailleau/simplelogging","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vpoulailleau%2Fsimplelogging","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vpoulailleau%2Fsimplelogging/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vpoulailleau%2Fsimplelogging/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vpoulailleau%2Fsimplelogging/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vpoulailleau","download_url":"https://codeload.github.com/vpoulailleau/simplelogging/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vpoulailleau%2Fsimplelogging/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271444181,"owners_count":24760738,"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","status":"online","status_checked_at":"2025-08-21T02:00:08.990Z","response_time":74,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["colorlog","debug","debugging","logger","logging","python","python3","simple"],"created_at":"2024-08-04T09:01:27.569Z","updated_at":"2025-08-21T07:32:10.411Z","avatar_url":"https://github.com/vpoulailleau.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# Simple Logging\n\n[![PyPI](https://img.shields.io/pypi/v/simplelogging.svg)](https://pypi.python.org/pypi/simplelogging)\n[![PyPI](https://img.shields.io/pypi/l/simplelogging.svg)](https://github.com/vpoulailleau/simplelogging/blob/master/LICENSE)\n[![Travis](https://img.shields.io/travis/vpoulailleau/simplelogging.svg)](https://travis-ci.org/vpoulailleau/simplelogging)\n[![ReadTheDocs](https://readthedocs.org/projects/simplelogging/badge/?version=latest)](https://simplelogging.readthedocs.io/en/latest/?badge=latest)\n[![Code style: Black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/ambv/black)\n[![Downloads](https://pepy.tech/badge/simplelogging)](https://pepy.tech/project/simplelogging)\n[![Test Coverage](https://api.codeclimate.com/v1/badges/4ad8f1bef2c011e8a5ac/test_coverage)](https://codeclimate.com/github/vpoulailleau/simplelogging/test_coverage)\n[![Maintainability](https://api.codeclimate.com/v1/badges/4ad8f1bef2c011e8a5ac/maintainability)](https://codeclimate.com/github/vpoulailleau/simplelogging/maintainability)\n\nLogging made simple, no excuse for any debug print call.\n\n* Free software: BSD 3-Clause license\n* Documentation: https://simplelogging.readthedocs.io.\n\n\n## Features\n\n* Logging management (debug, information or error messages)\n* Simple logging setup\n* Based on Python `logging` module of the standard library\n* Based on [colorlog](https://github.com/borntyping/python-colorlog) for colored log on console\n\nFor advanced users:\n\n* The provided logger is one of those from `logging`, this means it can be configured so that log messages are sent by email, HTTP, or any of the options available in https://docs.python.org/3/library/logging.handlers.html.\n* The StreamHandler and the associated Formatter are those provided by `colorlog`.\n\n## Example\n\n### Basic usage\n\n```python\nimport simplelogging\n\n# log = simplelogging.get_logger(console_level=simplelogging.DEBUG)\n# log = simplelogging.get_logger(file_name=\"log.txt\")\nlog = simplelogging.get_logger()\n\na_string_variable = \"hello\"\nan_integer_variable = 42\na_floating_point_variable = 3.14\n\nlog.debug(\"some debug\")\nlog.info(\"some info\")\nlog.info(\n    \"some variables: %s, %d, %f\",\n    a_string_variable,\n    an_integer_variable,\n    a_floating_point_variable,\n)\nlog.warning(\"some warning\")\nlog.error(\"some error\")\nlog.critical(\"some critical error\")\n\ntry:\n    x = 1 / 0\nexcept ZeroDivisionError as error:\n    log.exception(error)\n```\n\n![quickstart result](quickstart.png)\n\nKeep in mind that you shouldn't do string formatting yourself. Delegate formatting to `simplelogging` (i.e. `logging` in this case), the formatting will be done only if necessary, that is if the message is going to be displayed. See above examples of how to display variables.\n\n### Usage with modules\n\n#### example_module.py\n\n```python\nimport simplelogging\n\nlog = simplelogging.get_logger()\n\n\ndef log_some_messages():\n    log.debug(\"## some debug ##\")\n    log.info(\"## some info ##\")\n    log.warning(\"## some warning ##\")\n    log.error(\"## some error ##\")\n```\n\n#### main.py\n\n```python\nimport example_module\nimport simplelogging\n\n# log = simplelogging.get_logger(console_level=simplelogging.DEBUG)\n# log = simplelogging.get_logger(file_name=\"log.txt\")\nlog = simplelogging.get_logger()\n\na_variable = \"a nice variable\"\nanother_variable = 42\n\nlog.error(\"---- normal logging ----\")\nlog.debug(\"a debug message\")\nlog.info(\"an info\")\nlog.warning(\"a warning\")\nlog.error(\"%s and %d\", a_variable, another_variable)\n\nlog.error(\"---- example_module writes to the log ----\")\nexample_module.log_some_messages()\n\nlog.error(\"---- reduced logging (bye debug and info messages) ----\")\nlog.reduced_logging()\nlog.debug(\"a debug message\")\nlog.info(\"an info\")\nlog.warning(\"a warning\")\nlog.error(\"an error\")\n\nlog.error(\"---- full logging (welcome back debug and info messages) ----\")\nlog.full_logging()\nlog.debug(\"a debug message\")\nlog.info(\"an info\")\nlog.warning(\"a warning\")\nlog.error(\"an error\")\n```\n\n#### Result in the console\n\n\n![quickstart with modules result](with_modules.png)\n\nMore examples are provided in the documentation: https://simplelogging.readthedocs.io.\n\n## TODO\n\n* add tests\n* add type annotations\n* add docstring\n* commit hooks\n* describe pros/cons and alternatives\n* release 1.0!\n\n## Credits\n\nThis package is an extension of the [logging](https://docs.python.org/3/howto/logging-cookbook.html) package in the Python standard library. Coloring of the console relies on [colorlog](https://github.com/borntyping/python-colorlog).\n\n## Changelog\n\n### 0.12.0 (2024-07-02)\n\n* Drop Python 3.7 support\n* Switch to Poetry core as a build engine\n\n### 0.11.0 (2020-08-31)\n\n* Use poetry\n\n### 0.10.0 (2019-09-16)\n\n* setup.py: require pytest-runner only when necessary\n* Remove Python 3.4 support\n\n### 0.9.0 (2018-12-14)\n\n* Improve documentation\n* Add tests\n* Change API for easy logging level change\n\n### 0.8.0 (2018-12-09)\n\n* Improve documentation\n* Change default format: enlarge level size for critical errors\n\n### 0.7.0 (2018-12-08)\n\n* Fix logging to file\n\n### 0.6.0 (2018-12-07)\n\n* Colored output on console\n* Improved documentation\n\n### 0.5.0 (2018-12-02)\n\n* Fix README rendering in PyPI\n\n### 0.4.0 (2018-12-02)\n\n* Fix bump config\n\n### 0.3.0 (2018-12-02)\n\n* First release on PyPI.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvpoulailleau%2Fsimplelogging","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvpoulailleau%2Fsimplelogging","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvpoulailleau%2Fsimplelogging/lists"}