{"id":23975703,"url":"https://github.com/vladimirs-git/logger-color","last_synced_at":"2026-01-29T04:48:39.153Z","repository":{"id":115372660,"uuid":"558699544","full_name":"vladimirs-git/logger-color","owner":"vladimirs-git","description":"Python package to color logging messages","archived":false,"fork":false,"pushed_at":"2025-09-17T10:30:58.000Z","size":87,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-30T01:58:42.106Z","etag":null,"topics":["color","logger","logging"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/vladimirs-git.png","metadata":{"files":{"readme":"README.rst","changelog":"CHANGELOG.rst","contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2022-10-28T05:05:16.000Z","updated_at":"2025-09-17T10:31:03.000Z","dependencies_parsed_at":null,"dependency_job_id":"42ee2cba-e541-4571-88fe-e874a8e2ce90","html_url":"https://github.com/vladimirs-git/logger-color","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"purl":"pkg:github/vladimirs-git/logger-color","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vladimirs-git%2Flogger-color","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vladimirs-git%2Flogger-color/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vladimirs-git%2Flogger-color/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vladimirs-git%2Flogger-color/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/vladimirs-git","download_url":"https://codeload.github.com/vladimirs-git/logger-color/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/vladimirs-git%2Flogger-color/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28862791,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-28T22:56:21.783Z","status":"online","status_checked_at":"2026-01-29T02:00:06.714Z","response_time":59,"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","logger","logging"],"created_at":"2025-01-07T06:50:22.809Z","updated_at":"2026-01-29T04:48:39.139Z","avatar_url":"https://github.com/vladimirs-git.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\n.. image:: https://img.shields.io/pypi/v/logger-color.svg\n   :target: https://pypi.python.org/pypi/logger-color\n.. image:: https://img.shields.io/badge/Python-3.8%20%7C%203.9%20%7C%203.10%20%7C%203.11-blue.svg\n   :target: https://pypi.python.org/pypi/logger-color\n\nlogger-color\n============\n\nColor the log message headers and add more logging levels for diagnostics: DIAG_INFO, DIAG_WARNING.\n\n============== ===== ===========\nLevel          Int   Color\n============== ===== ===========\nDEBUG          10    gray\nINFO           20    green\nWARNING        30    yellow\nERROR          40    red\nCRITICAL       50    bold red\nDIAG_INFO      21    blue\nDIAG_WARNING   31    purple\n============== ===== ===========\n\n.. image:: https://github.com/vladimirs-git/logger-color/blob/main/docs/img/message_colors.png\n   :alt: Message colors\n\n\nRequirements\n------------\n\nPython \u003e=3.8,\u003c3.12\n\n\nInstallation\n------------\n\nInstall the package from pypi.org release\n\n.. code:: bash\n\n    pip install logger-color\n\nor install the package from github.com repository\n\n.. code:: bash\n\n    pip install git+https://github.com/vladimirs-git/logger-color\n\n\nstart_logging()\n---------------\n**start_logging(filename, mode, level, level_file, color, debug)** - Start logging\nwith the specified parameters\n\n\nParameters\n----------\n\n=========== ======= ======= ============================================================================================\nParameter   Type    Default Description\n=========== ======= ======= ============================================================================================\nfilename    *str*           Writes messages to this file. By default, logging only to the terminal\nmode        *str*   \"w\"     \"w\" - Writes to file (default), \"a\" - Appends to file\nlevel       *str*   INFO    Logging level for the terminal: \"DEBUG\", \"INFO\" (default), \"WARNING\", \"ERROR\", \"CRITICAL\", \"DIAG_INFO\", \"DIAG_WARNING\"\nlevel_file  *str*   level   Logging level for the file. By default, the same as `level` parameter\ncolor       *bool*  True    True  - Prints a colored message to the terminal (default), False - Prints a monochrome message to the terminal\ndebug       *bool*  False   True  - Sets logging level to DEBUG (rewrites `level` parameter), works the same as level=\"DEBUG\". False - Gets logging level from `level` parameter (default)\n=========== ======= ======= ============================================================================================\n\n\ndebug()\n-------\n**debug(args, kwargs)** - Log a message with severity \"DEBUG\"\n\n\ndiag_info()\n-----------\n**diag_info(msg, args, kwargs)** - Log diagnostic message with severity \"INFO\"\n\n\ndiag_warning()\n--------------\n**diag_warning(msg, args, kwargs)** - Log diagnostic message with severity \"WARNING\"\n\n\ninfo()\n------\n**info(args, kwargs)** - Log a message with severity \"INFO\"\n\n\nwarning()\n---------\n**warning(args, kwargs)** - Log a message with severity \"WARNING\"\n\n\nerror()\n-------\n**error(args, kwargs)** - Log a message with severity \"ERROR\"\n\n\ncritical()\n----------\n**warning(args, kwargs)** - Log a message with severity \"CRITICAL\"\n\n\n**Example**\n\n.. code:: python\n\n    import logger_color\n\n    logger_color.start_logging(filename=\"/var/log/test.log\", level=\"debug\", level_file=\"error\")\n    logger_color.debug(\"debug\")\n    logger_color.info(\"info\")\n    logger_color.warning(\"warning\")\n    logger_color.error(\"error\")\n    logger_color.critical(\"critical\")\n    logger_color.diag_info(\"diag_info\")\n    logger_color.diag_warning(\"diag_warning\")\n    # 2024-10-19 11:03:25.691 DEBUG    functions.debug: debug\n    # 2024-10-19 11:03:25.691 INFO     functions.info: info\n    # 2024-10-19 11:03:25.691 WARNING  functions.warning: warning\n    # 2024-10-19 11:03:25.691 ERROR    functions.error: error\n    # 2024-10-19 11:03:25.691 CRITICAL functions.critical: critical\n    # 2024-10-19 11:03:25.691 DIAG_I   examples_messages.\u003cmodule\u003e: diag_info\n    # 2024-10-19 11:03:25.691 DIAG_W   examples_messages.\u003cmodule\u003e: diag_warning\n\n    # cat /var/log/test.log\n    # 2024-10-19 11:03:25 ERROR    error\n    # 2024-10-19 11:03:25 CRITICAL critical\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvladimirs-git%2Flogger-color","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fvladimirs-git%2Flogger-color","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fvladimirs-git%2Flogger-color/lists"}