{"id":29021676,"url":"https://github.com/mapiv/richlogger","last_synced_at":"2025-06-26T02:07:32.615Z","repository":{"id":261542011,"uuid":"884606996","full_name":"MapIV/richlogger","owner":"MapIV","description":"Rich-formatted structured logging for Python with automatic syntax highlighting and beautiful console output.","archived":false,"fork":false,"pushed_at":"2024-12-22T01:01:49.000Z","size":80,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2024-12-22T02:17:50.387Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/MapIV.png","metadata":{"files":{"readme":"README.md","changelog":null,"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}},"created_at":"2024-11-07T03:57:35.000Z","updated_at":"2024-12-22T01:01:52.000Z","dependencies_parsed_at":"2024-11-07T05:28:14.505Z","dependency_job_id":"3a57c427-eaaa-4ccf-b2f8-27056bdf00ba","html_url":"https://github.com/MapIV/richlogger","commit_stats":null,"previous_names":["mapiv/richlogger"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/MapIV/richlogger","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MapIV%2Frichlogger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MapIV%2Frichlogger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MapIV%2Frichlogger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MapIV%2Frichlogger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MapIV","download_url":"https://codeload.github.com/MapIV/richlogger/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MapIV%2Frichlogger/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":261984645,"owners_count":23240305,"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":[],"created_at":"2025-06-26T02:07:27.227Z","updated_at":"2025-06-26T02:07:32.605Z","avatar_url":"https://github.com/MapIV.png","language":"Python","readme":"# Rich Logger\n\nA powerful Python logging utility that combines structured logging with rich text formatting and automatic syntax highlighting. Built on top of `structlog` and `rich` libraries, this logger provides beautiful console output with customizable styling and intelligent highlighting.\n\n## Features\n\n- 🎨 Rich text formatting with markup tags\n- 🔍 Automatic syntax highlighting for:\n  - XML/HTML tags and attributes\n  - IP addresses (IPv4, IPv6)\n  - MAC addresses (EUI-48, EUI-64)\n  - UUIDs\n  - Function calls\n  - Python literals (True, False, None)\n  - Numbers (including complex numbers)\n  - File paths\n  - String literals\n  - URLs\n- 📊 Structured logging with customizable columns\n- 🎯 Multiple log levels with color-coded output\n- ⏰ Automatic timestamp formatting\n- 🔑 Styled key-value pairs for context data\n\n## Installation\n\n```bash\npip install git+https://github.com/MapIV/richlogger\n```\n\n## Usage\n\n### Basic Usage\n\n```python\nfrom richlogger import Logger\n\n# Initialize logger with default INFO level\nlogger = Logger()\n\n# Basic logging\nlogger.info(\"Starting application\")\nlogger.debug(\"Debug information\")\nlogger.warning(\"Warning message\")\nlogger.error(\"Error occurred\")\nlogger.critical(\"Critical error!\")\n```\n\n### Rich Text Markup\n\nYou can use markup tags to style your log messages:\n\n```python\nlogger.info(\"Here are rich text markup examples:\")\nlogger.debug(\" - This is a debug message which most likely won't be seen\")\nlogger.info(\" - We are hiring. Visit our [link=https://map4.jp]website[/link]!\")\nlogger.warning(\" - :warning-emoji: We are going to have a problem\")\nlogger.error(\" - [bold red]ALERT![/bold red] Something happened\")\nlogger.critical(\" - :fire: :boom: :scream: :fire: :boom: :scream:\")\n```\n\n![!\\[example rich markup\\](images/example-rich-markup.png)](images/example-text-markup.png)\n\nYou can find available markup styles in the [rich docs](https://rich.readthedocs.io/en/stable/markup.html).\n\n### Log Levels\n\nThe logger supports standard Python log levels:\n\n- CRITICAL/FATAL\n- ERROR\n- WARNING/WARN\n- INFO (Default)\n- DEBUG\n- NOTSET\n\nSet the log level during initialization:\n\n```python\nlogger = Logger(log_level=\"DEBUG\")\n# or\nimport logging\nlogger = Logger(log_level=logging.DEBUG)\n```\n\n### Structured Logging\n\nAdd context with key-value pairs:\n\n```python\nlogger.info(\"User logged in\", user_id=\"123\", ip=\"192.168.1.1\")\nlogger.error(\"Database connection failed\",\n             retry_count=3,\n             database=\"users\")\n```\n\n## Automatic Highlighting\n\nThe logger automatically highlights various patterns in your log messages:\n\n- XML/HTML: `\u003ctag\u003econtent\u003c/tag\u003e`\n- IP addresses: `192.168.1.1`, `2001:db8::1`\n- MAC addresses: `00:1B:44:11:3A:B7`\n- UUIDs: `123e4567-e89b-12d3-a456-426614174000`\n- Python literals: `True`, `False`, `None`\n- Numbers: `42`, `3.14`, `1+2j`\n- Paths: `/usr/local/bin`\n- URLs: `https://example.com`\n\n```python\nlogger.info(\"The following texts are automatically highlighted:\")\nlogger.info(\" - XML/HTML: `\u003ctag\u003econtent\u003c/tag\u003e`\")\nlogger.info(\" - IP addresses: `192.168.1.1`, `2001:db8::1`\")\nlogger.info(\" - MAC addresses: `00:1B:44:11:3A:B7`\")\nlogger.info(\" - UUIDs: `123e4567-e89b-12d3-a456-426614174000`\")\nlogger.info(\" - Python literals: `True`, `False`, `None`\")\nlogger.info(\" - Numbers: `42`, `3.14`, `1+2j`\")\nlogger.info(\" - Paths: `/usr/local/bin`\")\nlogger.info(\" - URLs: `https://map4.jp`\")\n```\n\n![!\\[example auto highlighting\\](images/example-auto-highlighting.png)](images/example-auto-highlighting.png)\n\n## Dependencies\n\n- Python 3.8+\n- `structlog`\n- `rich`\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmapiv%2Frichlogger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmapiv%2Frichlogger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmapiv%2Frichlogger/lists"}