{"id":23328837,"url":"https://github.com/healkeiser/fxlog","last_synced_at":"2026-02-14T16:04:29.800Z","repository":{"id":266194300,"uuid":"897622605","full_name":"healkeiser/fxlog","owner":"healkeiser","description":"A custom logging module for Python that supports colorized output and log file rotation.","archived":false,"fork":false,"pushed_at":"2026-01-02T13:18:15.000Z","size":2264,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-01-08T16:52:23.385Z","etag":null,"topics":["logging","python","utility"],"latest_commit_sha":null,"homepage":"","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/healkeiser.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","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},"funding":{"github":["healkeiser"],"patreon":"valentinbeaumont","buy_me_a_coffee":"healkeiser"}},"created_at":"2024-12-03T00:18:05.000Z","updated_at":"2026-01-02T13:17:25.000Z","dependencies_parsed_at":null,"dependency_job_id":"90223816-afe4-4edc-ae21-146d8fbaf4c1","html_url":"https://github.com/healkeiser/fxlog","commit_stats":null,"previous_names":["healkeiser/fxlog"],"tags_count":2,"template":false,"template_full_name":"healkeiser/python_package","purl":"pkg:github/healkeiser/fxlog","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/healkeiser%2Ffxlog","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/healkeiser%2Ffxlog/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/healkeiser%2Ffxlog/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/healkeiser%2Ffxlog/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/healkeiser","download_url":"https://codeload.github.com/healkeiser/fxlog/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/healkeiser%2Ffxlog/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29448985,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-14T15:52:44.973Z","status":"ssl_error","status_checked_at":"2026-02-14T15:52:11.208Z","response_time":53,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["logging","python","utility"],"created_at":"2024-12-20T21:19:41.419Z","updated_at":"2026-02-14T16:04:29.795Z","avatar_url":"https://github.com/healkeiser.png","language":"Python","funding_links":["https://github.com/sponsors/healkeiser","https://patreon.com/valentinbeaumont","https://buymeacoffee.com/healkeiser","https://www.buymeacoffee.com/healkeiser"],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n  ![Logo](https://raw.githubusercontent.com/healkeiser/fxlog/main/fxlog/images/icons/fxlog_logo_background_dark.svg#gh-light-mode-only)\n  ![Logo](https://raw.githubusercontent.com/healkeiser/fxlog/main/fxlog/images/icons/fxlog_logo_background_light.svg#gh-dark-mode-only)\n\n  \u003ch3 align=\"center\"\u003efxlog\u003c/h3\u003e\n\n  \u003cp align=\"center\"\u003e\n    A custom logging module for Python that supports colorized output and log file rotation.\n    \u003cbr/\u003e\u003cbr/\u003e\n    \u003c!-- \u003ca href=\"https://healkeiser.github.io/fxlog\"\u003e\u003cstrong\u003eDocumentation\u003c/strong\u003e\u003c/a\u003e --\u003e\n  \u003c/p\u003e\n\n  ##\n\n  \u003cp align=\"center\"\u003e\n    \u003c!-- Maintenance status --\u003e\n    \u003cimg src=\"https://img.shields.io/badge/maintenance-actively--developed-brightgreen.svg?\u0026label=Maintenance\"\u003e\u0026nbsp;\u0026nbsp;\n    \u003c!-- \u003cimg src=\"https://img.shields.io/badge/maintenance-deprecated-red.svg?\u0026label=Maintenance\"\u003e\u0026nbsp;\u0026nbsp; --\u003e\n    \u003c!-- License --\u003e\n    \u003cimg src=\"https://img.shields.io/badge/License-MIT-brightgreen.svg?\u0026logo=open-source-initiative\u0026logoColor=white\" alt=\"License: MIT\"/\u003e\u0026nbsp;\u0026nbsp;\n    \u003c!-- GitHub build workflow --\u003e\n    \u003cimg src=\"https://img.shields.io/github/actions/workflow/status/healkeiser/fxlog/release.yml?\u0026label=Build\u0026logo=github-actions\u0026logoColor=white\" alt=\"Build\"\u003e \u0026nbsp;\u0026nbsp;\n    \u003c!-- PyPI Version--\u003e\n    \u003ca href=\"https://pypi.org/project/fxlog\"\u003e\n      \u003cimg src=\"https://img.shields.io/pypi/v/fxlog?\u0026logo=pypi\u0026logoColor=white\u0026label=Version\" alt=\"PyPI version\"/\u003e\u003c/a\u003e\u0026nbsp;\u0026nbsp;\n    \u003c!-- PyPI downloads --\u003e\n    \u003ca href=\"https://pepy.tech/project/fxlog\"\u003e\n      \u003cimg src=\"https://static.pepy.tech/badge/fxlog\" alt=\"PyPI Downloads\"\u003e\u003c/a\u003e\u0026nbsp;\u0026nbsp;\n    \u003c!-- Last Commit --\u003e\n    \u003cimg src=\"https://img.shields.io/github/last-commit/healkeiser/fxlog?logo=github\u0026label=Last%20Commit\" alt=\"Last Commit\"/\u003e\u0026nbsp;\u0026nbsp;\n    \u003c!-- Commit Activity --\u003e\n    \u003ca href=\"https://github.com/healkeiser/fxlog/pulse\" alt=\"Activity\"\u003e\n      \u003cimg src=\"https://img.shields.io/github/commit-activity/m/healkeiser/fxlog?\u0026logo=github\u0026label=Commit%20Activity\"/\u003e\u003c/a\u003e\u0026nbsp;\u0026nbsp;\n    \u003c!-- GitHub stars --\u003e\n    \u003cimg src=\"https://img.shields.io/github/stars/healkeiser/fxlog\" alt=\"GitHub Stars\"/\u003e\u0026nbsp;\u0026nbsp;\n  \u003c/p\u003e\n\n\u003c/div\u003e\n\n\n\n\u003c!-- TABLE OF CONTENTS --\u003e\n## Table of Contents\n\n- [About](#about)\n- [Installation](#installation)\n- [How-to Use](#how-to-use)\n  - [Save Log Files](#save-log-files)\n  - [Do Not Save Log Files](#do-not-save-log-files)\n  - [Set Log Level](#set-log-level)\n  - [Set Formatter](#set-formatter)\n- [Contact](#contact)\n\n\n\n\u003c!-- ABOUT --\u003e\n## About\n\nA custom logging module for Python that supports colorized output and log file rotation. Includes features such as configurable log levels, custom formatters, and automatic deletion of old log files.\n\n\n\n\u003c!-- INSTALLATION --\u003e\n## Installation\n\nThe package is available on [PyPI](https://pypi.org/project/fxlog) and can be installed via `pip`:\n\n```shell\npython -m pip install fxlog\n```\n\n\n\n\u003c!-- HOW-TO USE --\u003e\n## How-to Use\n\nYou can use the `fxlog` module in your Python scripts as follows:\n\n### Save Log Files\n\nIf you want to save the log files \u003csup\u003e[1](#footnote1)\u003c/sup\u003e, import the `fxlog` module, and set the log directory where log files will be stored:\n\n```python\nfrom fxlog import fxlogger\n\nfxlogger.set_log_directory('path/to/log/directory')\n```\n\nE.g.,\n\n```python\nimport os\nfrom pathlib import Path\nfrom fxlog import fxlogger\n\n\n_PACKAGE_NAME = \"package_name\"\nDATA_DIR = (\n    Path(os.getenv(\"APPDATA\")) / _PACKAGE_NAME\n    if os.name == \"nt\"\n    else Path.home() / f\".{_PACKAGE_NAME}\"\n)\nLOG_DIR = DATA_DIR / \"logs\"\nLOG_DIR.mkdir(parents=True, exist_ok=True)\n\nfxlogger.set_log_directory(LOG_DIR)\n```\n\n\u003e [!NOTE]\n\u003e This only needs to be done once in your package.\n\nThen, you can use the `fxlog` module to create a logger object and log messages to the console and a log file:\n\n```python\nfrom fxlog import fxlogger\n\nlogger = fxlogger.configure_logger('my_logger')\nlogger.debug('This is a debug message')\n```\n\nTo delete old log files, you can use the `fxlog` module as follows:\n\n```python\nfrom fxlog import fxlogger\n\nfxlogger.delete_old_logs(7) # Delete log files older than 7 days\n```\n\nYou can also clear all log files in the log directory:\n\n```python\nfrom fxlog import fxlogger\n\nfxlogger.clear_logs()\n```\n\n\u003e [!NOTE]\n\u003e \u003csup id=\"footnote1\"\u003e1\u003c/sup\u003e The log files are constructed with the following naming convention: `\u003clogger_name\u003e_\u003cyear\u003e-\u003cmonth\u003e-\u003cday\u003e.log`.\n\n### Do Not Save Log Files\n\nIf you don't want to save the log files, you can use the `fxlog` module as follows:\n\n```python\nfrom fxlog import fxlogger\n\nlogger = fxlogger.configure_logger('my_logger', save_to_file=False)\nlogger.debug('This is a debug message')\n```\n\n### Set Log Level\n\nYou can set the log level of **all** loggers by using the `set_loggers_level` function:\n\n```python\nfrom fxlog import fxlogger\n\nfxlogger.set_loggers_level(fxlogger.DEBUG) # You can also use `logging.DEBUG`\n```\n\n### Set Formatter\n\nBy default, the output looks like this:\n\n\u003cp align=\"center\"\u003e\n  \u003cimg width=\"800\" src=\"docs/images/basic.png\"\u003e\n\u003c/p\u003e\n\nYou can enable a colored output by setting the `enable_color` parameter to `True`. The messages will be colorized according to their log levels:\n\n```python\nfrom fxlog import fxlogger\n\nlogger = fxlogger.configure_logger('my_logger', enable_color=True)\nlogger.debug('This is a debug message')\n```\n\n\u003cp align=\"center\"\u003e\n  \u003cimg width=\"800\" src=\"docs/images/color.png\"\u003e\n\u003c/p\u003e\n\n\u003e [!NOTE]\n\u003e Colors are not saved in log files.\n\n\u003e [!WARNING]\n\u003e If `enable_color` is set to `True` but the terminal does not support colorized output, the messages will be displayed in their original form.\n\nYou can also enable a separator between log messages by setting the `enable_separator` parameter to `True`:\n\n```python\nfrom fxlog import fxlogger\n\nlogger = fxlogger.configure_logger('my_logger', enable_separator=True)\nlogger.debug('This is a debug message')\n```\n\n\u003cp align=\"center\"\u003e\n  \u003cimg width=\"800\" src=\"docs/images/color_separator.png\"\u003e\n\u003c/p\u003e\n\n\n\n\u003c!-- CONTACT --\u003e\n## Contact\n\nProject Link: [fxlog](https://github.com/healkeiser/fxlog)\n\n\u003cp align='center'\u003e\n  \u003c!-- GitHub profile --\u003e\n  \u003ca href=\"https://github.com/healkeiser\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/healkeiser-181717?logo=github\u0026style=social\" alt=\"GitHub\"/\u003e\u003c/a\u003e\u0026nbsp;\u0026nbsp;\n  \u003c!-- LinkedIn --\u003e\n  \u003ca href=\"https://www.linkedin.com/in/valentin-beaumont\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/Valentin%20Beaumont-0A66C2?logo=linkedin\u0026style=social\" alt=\"LinkedIn\"/\u003e\u003c/a\u003e\u0026nbsp;\u0026nbsp;\n  \u003c!-- Behance --\u003e\n  \u003ca href=\"https://www.behance.net/el1ven\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/el1ven-1769FF?logo=behance\u0026style=social\" alt=\"Behance\"/\u003e\u003c/a\u003e\u0026nbsp;\u0026nbsp;\n  \u003c!-- X --\u003e\n  \u003ca href=\"https://twitter.com/valentinbeaumon\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/@valentinbeaumon-1DA1F2?logo=x\u0026style=social\" alt=\"Twitter\"/\u003e\u003c/a\u003e\u0026nbsp;\u0026nbsp;\n  \u003c!-- Instagram --\u003e\n  \u003ca href=\"https://www.instagram.com/val.beaumontart\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/@val.beaumontart-E4405F?logo=instagram\u0026style=social\" alt=\"Instagram\"/\u003e\u003c/a\u003e\u0026nbsp;\u0026nbsp;\n  \u003c!-- Gumroad --\u003e\n  \u003ca href=\"https://healkeiser.gumroad.com/subscribe\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/healkeiser-36a9ae?logo=gumroad\u0026style=social\" alt=\"Gumroad\"/\u003e\u003c/a\u003e\u0026nbsp;\u0026nbsp;\n  \u003c!-- Gmail --\u003e\n  \u003ca href=\"mailto:valentin.onze@gmail.com\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/valentin.onze@gmail.com-D14836?logo=gmail\u0026style=social\" alt=\"Email\"/\u003e\u003c/a\u003e\u0026nbsp;\u0026nbsp;\n  \u003c!-- Buy me a coffee --\u003e\n  \u003ca href=\"https://www.buymeacoffee.com/healkeiser\"\u003e\n    \u003cimg src=\"https://img.shields.io/badge/Buy Me A Coffee-FFDD00?\u0026logo=buy-me-a-coffee\u0026logoColor=black\" alt=\"Buy Me A Coffee\"/\u003e\u003c/a\u003e\u0026nbsp;\u0026nbsp;\n\u003c/p\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhealkeiser%2Ffxlog","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhealkeiser%2Ffxlog","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhealkeiser%2Ffxlog/lists"}