{"id":34083032,"url":"https://github.com/oscar-defelice/coloured-logger","last_synced_at":"2026-04-21T12:02:53.182Z","repository":{"id":208407521,"uuid":"721531421","full_name":"oscar-defelice/coloured-logger","owner":"oscar-defelice","description":"A python package to make life and especially log messages full of colours","archived":false,"fork":false,"pushed_at":"2023-11-23T12:49:05.000Z","size":405,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"develop","last_synced_at":"2025-09-30T09:12:34.276Z","etag":null,"topics":["color-log","color-logger","logger","logging","python"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/coloured-logger/","language":"JavaScript","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/oscar-defelice.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-11-21T08:58:29.000Z","updated_at":"2023-12-14T13:18:44.000Z","dependencies_parsed_at":"2023-11-21T11:28:46.463Z","dependency_job_id":null,"html_url":"https://github.com/oscar-defelice/coloured-logger","commit_stats":null,"previous_names":["oscar-defelice/coloured-logger"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/oscar-defelice/coloured-logger","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oscar-defelice%2Fcoloured-logger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oscar-defelice%2Fcoloured-logger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oscar-defelice%2Fcoloured-logger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oscar-defelice%2Fcoloured-logger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oscar-defelice","download_url":"https://codeload.github.com/oscar-defelice/coloured-logger/tar.gz/refs/heads/develop","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oscar-defelice%2Fcoloured-logger/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":27728262,"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-12-14T02:00:11.348Z","response_time":56,"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":["color-log","color-logger","logger","logging","python"],"created_at":"2025-12-14T12:33:37.443Z","updated_at":"2025-12-14T12:33:41.610Z","avatar_url":"https://github.com/oscar-defelice.png","language":"JavaScript","funding_links":["https://www.patreon.com/oscardefelice"],"categories":[],"sub_categories":[],"readme":"![pypi](https://img.shields.io/pypi/v/coloured-logger.svg)\n![python](https://img.shields.io/pypi/pyversions/coloured-logger.svg)\n![license](https://img.shields.io/github/license/oscar-defelice/coloured-logger.svg)\n![last-commit](https://img.shields.io/github/last-commit/oscar-defelice/coloured-logger/develop)\n![docs](https://readthedocs.org/projects/coloured-logger/badge/?version=latest)\n[![patreon](https://img.shields.io/badge/Patreon-brown.svg?logo=patreon)](https://www.patreon.com/oscardefelice)\n[![follow](https://img.shields.io/twitter/follow/oscardefelice.svg?style=social)](https://twitter.com/OscardeFelice)\n[![linkedin](https://img.shields.io/badge/LinkedIn-0077B5?\u0026logo=linkedin\u0026logoColor=white)](https://linkedin.com/in/oscar-de-felice)\n\n# ColouredLogger\n\n\u003c!-- markdownlint-disable MD033 --\u003e\n\u003cdiv align=\"center\"\u003e\n    \u003cimg src=\"https://raw.githubusercontent.com/oscar-defelice/coloured-logger/develop/images/logo.png\" width=\"800px\"\u003e\n\u003c/div\u003e\n\u003c!-- markdownlint-enable MD033 --\u003e\n\n`coloured-logger` is a Python package that provides a customised logger with coloured output and the ability to set verbosity levels dynamically.\n\n## Installation\n\nYou can install My Coloured Logger using pip:\n\n```bash\npip install coloured-logger\n```\n\n## Usage\n\nAs all the good loggers you simply use it as the standard logger\n\n```python\nfrom coloured_logger import Logger\n\nlogger = Logger(__name__) # Or any other name you want\n\nlogger.info(\"This is an informational message.\")\nlogger.debug(\"This debug message won't be displayed.\")\n```\n\nColour scheme is customisable by user using the [ANSI escape codes](https://gist.github.com/fnky/458719343aabd01cfb17a3a4f7296797) for colours.\nThese are typically defined in terms of foreground and background colours, and each color has an associated numeric code. Here is a common mapping:\n\n### Colour codes\n\nMost terminals support 8 and 16 colours, as well as 256 (8-bit) colours. These colours are set by the user, but have commonly defined meanings.\n\n#### 8-16 Colours\n\n| Colour Name | Foreground Colour Code | Background Colour Code |\n| :--------- | :-------------------- | :-------------------- |\n| Black      | `30`                  | `40`                  |\n| Red        | `31`                  | `41`                  |\n| Green      | `32`                  | `42`                  |\n| Yellow     | `33`                  | `43`                  |\n| Blue       | `34`                  | `44`                  |\n| Magenta    | `35`                  | `45`                  |\n| Cyan       | `36`                  | `46`                  |\n| White      | `37`                  | `47`                  |\n| Default    | `39`                  | `49`                  |\n| Reset      | `0`                   | `0`                   |\n\n\u003e **Note:** the _Reset_ colour is the reset code that resets _all_ colours and text effects, Use _Default_ colour to reset colours only.\n\nMost terminals, apart from the basic set of 8 colors, also support the \"bright\" or \"bold\" colours. These have their own set of codes, mirroring the normal colours, but with an additional `;1` in their codes:\n\n```sh\n# Set style to bold, red foreground.\n\\x1b[1;31mHello\n# Set style to dimmed white foreground with red background.\n\\x1b[2;37;41mWorld\n```\n\n### A simplified configuration\n\nThe user can simply define a python dictionary in order to change logger colours with a simplified colour scheme.\n\n#### Configure logger colours\n\nIn order to configure the logger colours, the user can use the following code\n\n```python\nfrom coloured_logger import Logger\n\nmy_custom_colours = {\n    \"WARNING\": 4,  # Yellow background with blue text\n    \"INFO\": 2,     # Green text\n    \"DEBUG\": 6,    # Cyan text\n    \"CRITICAL\": 1, # Red text\n    \"ERROR\": 5     # Magenta text\n}\n\n# This can change the logger level\nlogger_level = \"DEBUG\"\n\nlogger = Logger(__name__, my_custom_colours, logger_level)\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foscar-defelice%2Fcoloured-logger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foscar-defelice%2Fcoloured-logger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foscar-defelice%2Fcoloured-logger/lists"}