Skip to main content

Loguru-Discord

PyPI version Supported Python versions Build status Coverage report PyPI downloads

Forward Loguru logs to Discord webhooks.

Loguru-Discord is a lightweight sink for Loguru that forwards logs to Discord via the Webhook API.

Features

  • Plug-and-play adoption with your existing logging structure
  • Configurable usernames, avatars, rich formatting, and attachments for oversized messages
  • Fully type-hinted for an excellent developer experience
  • Native and performant Webhook API interaction powered by Clyde
  • Opt-in interception of standard library logging events, unified under Loguru

Preview

Getting Started

Installation

Install with uv (recommended):

uv add loguru-discord

Alternatively, install with pip:

pip install loguru-discord

Quick Start

Replace the placeholder with your Discord webhook URL:

from loguru import logger
from loguru_discord import DiscordSink

# Construct the Discord handler
sink: DiscordSink = DiscordSink(
    "https://discord.com/api/webhooks/00000000/XXXXXXXX", rich=True
)

# Add the sink to Loguru
logger.add(sink)

# Log an exception
try:
    value: float = 1 / 0
except Exception as e:
    logger.opt(exception=e).error("Calculation failed")

Documentation

See the documentation for more examples and configuration options.

Releases

Loguru-Discord loosely follows Semantic Versioning for consistent, predictable releases.

Contributing

See the contributor guide to report bugs, propose features, or work on documentation.

Acknowledgments

This project is not affiliated with or endorsed by Loguru or Discord in any way.

Metadata

Release files for loguru-discord 2.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for loguru-discord 2.2.0
File Size Uploaded
loguru_discord-2.2.0.tar.gz 265.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for loguru-discord 2.2.0
File Interpreter ABI Platform
loguru_discord-2.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 294.0 kB

Release files / loguru_discord-2.2.0.tar.gz

Download URL loguru_discord-2.2.0.tar.gz
Size 265.6 kB
Tags Source
SHA-256 checksum
How to use checksums
ee5644af16c6ecdba162c891d5673ed61801895b8cf8fe078cfcf211069a0306
BLAKE2b-256 checksum
How to use checksums
ff05a4bfaa3df8f46ee62e3920cee189e5e5b5722b0fc3c30da35c1aaf8f3100
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.19 {"installer":{"name":"uv","version":"0.12.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / loguru_discord-2.2.0-py3-none-any.whl

Download URL loguru_discord-2.2.0-py3-none-any.whl
Size 28.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
20e16f8e6b84f5879207de120056d709d0ac9f80973fd76740d2f5822e8942f9
BLAKE2b-256 checksum
How to use checksums
5a67385ac3212b0b3448b5e1c456bd0c97914006a167a3f46be9749a61f9cce9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.12.19 {"installer":{"name":"uv","version":"0.12.19","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

2.2.0 This release

2 release files

2.1.0

2 release files

2.0.1

2 release files

2.0.0

2 release files

1.4.0

2 release files

1.3.1

2 release files

1.3.0

2 release files

1.2.2

2 release files

1.2.1

2 release files

1.2.0

2 release files

1.1.1

2 release files

1.1.0

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page