Skip to main content

Simple Discord webhook logger for Python

Project description

Discord Logger

PyPI Python License

Simple Discord webhook logger for Python.


Installation

pip install baihu-discord-logger

Environment Variables (Optional)

You can configure avatars using environment variables instead of passing them in code:

  • DISCORD_OWNER_AVATAR_URL
  • DISCORD_WEBHOOK_AVATAR_URL

If these are not provided, the logger will default to None.


Set Environment Variables (Permanent Only)

Windows (PowerShell)

setx DISCORD_OWNER_AVATAR_URL "https://example.com/owner.png"
setx DISCORD_WEBHOOK_AVATAR_URL "https://example.com/webhook.png"

After setting, restart terminal or VSCode to apply changes.


Linux / macOS (bash / zsh)

Add the following lines to your shell configuration file (~/.bashrc, ~/.zshrc, or ~/.profile):

echo 'export DISCORD_OWNER_AVATAR_URL="https://example.com/owner.png"' >> ~/.bashrc
echo 'export DISCORD_WEBHOOK_AVATAR_URL="https://example.com/webhook.png"' >> ~/.bashrc

Then reload configuration:

source ~/.bashrc

(or restart your terminal if using zsh/macOS default shell)


Usage

from discord_logger import DiscordLogger

logger = DiscordLogger(webhook_url="YOUR_WEBHOOK_URL")

logger.info(title="Server", description="Server started")
logger.error(title="Database", description="Database crashed")

License

MIT License

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

baihu_discord_logger-0.1.3.tar.gz (3.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

baihu_discord_logger-0.1.3-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file baihu_discord_logger-0.1.3.tar.gz.

File metadata

  • Download URL: baihu_discord_logger-0.1.3.tar.gz
  • Upload date:
  • Size: 3.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for baihu_discord_logger-0.1.3.tar.gz
Algorithm Hash digest
SHA256 11aba7f50f90a258c349ea4cabd07122e6fa6695664ba22e10505176b0dfc739
MD5 4e5ce8851c2315453003779c5f3d65f5
BLAKE2b-256 bfa1c78d1d5f409661f9829ba53c5d4a7acf77c4497970fb95fd0b6240af3db8

See more details on using hashes here.

File details

Details for the file baihu_discord_logger-0.1.3-py3-none-any.whl.

File metadata

File hashes

Hashes for baihu_discord_logger-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 5d79d7d6d0f57447169b3b4be4641d73e33b4e7de0810137ea2ad74db529881c
MD5 67f3d08075b001e9cb0bc1be7e8e8d42
BLAKE2b-256 0625db53cd9a7c635f0e0a6a4b90643699be7b5aceb9ed86053538cd968fff53

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page