Skip to main content

pytelog

Simple logger which dispatch messages to a telegram in markdown format. Uses a separate thread for a dispatching. Support many chats. Support big messages (over 4096 chars). Support telegram API calls restrictions.

Installation

pip install pytelog

Quick start

1. Configuration

config = {
    ...
    "version": 1,
    "disable_existing_loggers": False,
    "handlers": {
        "telegram": {
            "class": "pytelog.Handler",
            "token": "bot_token",
            "chat_ids": [123456789, -1234567891011],

        }
    },
    "loggers": {
        "telegram": {
            "level": "INFO",
            "handlers": ["telegram",]
        }
    }
}

2. Usage

import logging
logger = logging.getLogger("telegram")

logger.info("Message")

3. Formatting:

config = {
    ...
    "version": 1,
    "disable_existing_loggers": False,
    "formatters": {
        "telegram": {
            "()": "pytelog.MarkdownFormatter",
        }
    },
    ...
}

Release files for pytelog 0.1

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

Built distribution (wheel)

Table of built distributions (wheels) for pytelog 0.1
File Interpreter ABI Platform
pytelog-0.1-py3-none-any.whl Python 3 none any Details

Release files / pytelog-0.1-py3-none-any.whl

Download URL pytelog-0.1-py3-none-any.whl
Size 5.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4e4e134161e6f258d89907f52b67816b83cc6ff436b3321d78ff7310bd15232e
BLAKE2b-256 checksum
How to use checksums
ca4b88127b07b80c5fa423c82bee382d5c13344e7cdac2b61a76f2b2cddb6a7a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/46.4.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.2

Release history Release notifications | RSS feed

This release

0.1 This release

1 release file

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