{"id":19416892,"url":"https://github.com/ethanc/loguru-discord","last_synced_at":"2025-04-24T13:33:13.166Z","repository":{"id":178219370,"uuid":"661444612","full_name":"EthanC/Loguru-Discord","owner":"EthanC","description":"Lightweight sink for Loguru that sends logs to Discord via webhook.","archived":false,"fork":false,"pushed_at":"2025-03-11T07:51:20.000Z","size":115,"stargazers_count":11,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-03T05:51:08.843Z","etag":null,"topics":["discord","embed","handler","log","logger","logging","loguru","notification","notifier","notify","python","sink","traceback","webhook"],"latest_commit_sha":null,"homepage":"https://pypi.org/project/loguru-discord/","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"agpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/EthanC.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":".github/CONTRIBUTING.md","funding":".github/FUNDING.yaml","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},"funding":{"custom":["https://cash.app/$EthanChrisp","https://venmo.com/u/Mxtive"]}},"created_at":"2023-07-02T21:32:39.000Z","updated_at":"2025-03-11T07:51:23.000Z","dependencies_parsed_at":"2025-03-11T08:37:55.866Z","dependency_job_id":null,"html_url":"https://github.com/EthanC/Loguru-Discord","commit_stats":null,"previous_names":["ethanc/loguru-discord"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EthanC%2FLoguru-Discord","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EthanC%2FLoguru-Discord/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EthanC%2FLoguru-Discord/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/EthanC%2FLoguru-Discord/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/EthanC","download_url":"https://codeload.github.com/EthanC/Loguru-Discord/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250636261,"owners_count":21463037,"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":["discord","embed","handler","log","logger","logging","loguru","notification","notifier","notify","python","sink","traceback","webhook"],"created_at":"2024-11-10T13:06:04.750Z","updated_at":"2025-04-24T13:33:12.873Z","avatar_url":"https://github.com/EthanC.png","language":"Python","funding_links":["https://cash.app/$EthanChrisp","https://venmo.com/u/Mxtive"],"categories":[],"sub_categories":[],"readme":"# Loguru-Discord\n\n![PyPI - Python Version](https://img.shields.io/pypi/pyversions/loguru-discord?label=Python) ![PyPI - Status](https://img.shields.io/pypi/status/loguru-discord?label=PyPI%20Status) ![PyPI - Downloads](https://img.shields.io/pypi/dm/loguru-discord?label=PyPI%20Downloads)\n\nLightweight sink for [Loguru](https://github.com/Delgan/loguru) that sends logs to [Discord](https://discord.com/) via webhook.\n\n\u003cp align=\"center\"\u003e\n    \u003cimg src=\"https://i.imgur.com/aS7wt4c.png\" draggable=\"false\"\u003e\n\u003c/p\u003e\n\n## Usage\n\nConstruct a handler with your preferred options, then add a new sink to Loguru.\n\n### Installation\n\nSupport is guaranteed only for Python 3.12 or greater.\n\nOnce this requirement is met, simply install via your package manager of choice.\n\n```\npip install loguru-discord\n```\n\n### Example\n\nThe following code is a complete example which demonstrates:\n\n-   Constructing a handler\n-   Adding the handler as a Loguru sink\n-   Catching an exception and firing a log\n\n```py\nfrom loguru import logger\nfrom loguru_discord import DiscordSink\n\nlogger.add(DiscordSink(\"https://discord.com/api/webhooks/00000000/XXXXXXXX\"))\n\ntry:\n    value: float = 1 / 0\nexcept Exception as e:\n    logger.opt(exception=e).error(\"Lorem ipsum dolor sit amet\")\n```\n\n## Customization\n\nUpon constructing your handler, the following optional customizations are available via keyword arguments.\n\n-   **Username**: Username to use for the Discord Webhook message.\n-   **Avatar**: Image URL to use for the Discord Webhook message.\n-   **Embed**: Toggle whether to use plain codeblock formatting or rich embeds.\n-   **Truncate**: Toggle whether to trim lengthy logs instead of uploading as a file.\n-   **Suppress**: Prevent specific Exception types from being sent to Discord.\n\n## Releases\n\nLoguru-Discord follows [Semantic Versioning](https://semver.org/) for tagging releases of the project.\n\n## Contributing\n\nBug fixes and optimizations are always welcome. See [`CONTRIBUTING.md`](https://github.com/EthanC/Loguru-Discord/blob/master/.github/CONTRIBUTING.md) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fethanc%2Floguru-discord","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fethanc%2Floguru-discord","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fethanc%2Floguru-discord/lists"}