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):

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

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.1.tar.gz (3.8 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.1-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: baihu_discord_logger-0.1.1.tar.gz
  • Upload date:
  • Size: 3.8 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.1.tar.gz
Algorithm Hash digest
SHA256 8c99085d46b5a5732ec179efb8e47c633e7845e50b9c6f8d7ce41c5dbd7eaec7
MD5 a8a8f3fbff8bcf3b2e8e7ac0f8673a91
BLAKE2b-256 6cec8415bdc1487b67b8f243161f60f4cccf6b6b383af8d38b4868c451280d7f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for baihu_discord_logger-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a81285fd84701822a8638586cd10faaad8f9b14508ba7b3d056f63eb43be90cd
MD5 859f3564de3d59b6e0328939ff08279f
BLAKE2b-256 6124c46811d96713fa43e6a8dd6b4529ee09399eafc95a201f091d7c77b0b05b

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