Giter Site home page Giter Site logo

otter18 / tg_logger Goto Github PK

View Code? Open in Web Editor NEW
40.0 40.0 9.0 506 KB

Python library that bridges logging and user files to telegram bot

Home Page: https://pypi.org/project/tg-logger/

License: MIT License

Python 100.00%
filesharing logging logging-handler telegram telegram-bot tg-logger

tg_logger's Introduction

Hi there 👋

tg_logger's People

Contributors

otter18 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

tg_logger's Issues

set handler severity

Hello!
I have used your library as another handler.

    handler_n1.setLevel(logging.INFO)
    handler_n2.setLevel(logging.DEBUG)
    handler_n3.setLevel(logging.DEBUG)
    my_logger.addHandler(handler_n1)
    my_logger.addHandler(handler_n2)
    my_logger.addHandler(handler_n3)
    tg_logger.setup(my_logger, token=token, users=[chat_id])

For existing handlers, I set the level in the standard way. Please tell me how to set the level for your handler?

Ошибка при отправке большого сообщения

В случае если тест ошибки достаточно объёмный, например в случае если я вызываю logger.exception() дабы отправить стектрейс - я получаю ошибку 431. Максимальный размер 1 сообщения в тг - 4096 символов. Можно сделать что-то типо

while time() - t0 < self.timeout:
    try:
        if len(info) > 4096:
            for offset in range(0, len(msg), 4096):
                self.bot.send_message(user_id, msg[offset:offset+4096], parse_mode="HTML")
        else:
            self.bot.send_message(user_id, msg, parse_mode="HTML")
        break
    except Exception as ex:
        logger.exception("Exception while sending %s to %s:", msg, user_id)
        sleep(1)

requirements

Hello!
Do you really need pyTelegramBotAPI==3.7.6 exactly?
Or you can use pyTelegramBotAPI>=3.7.6 requirement?
I use in my project latest pyTelegramBotAPI and your module version 3.2 (beta). If you don't have a clear reason to use the exact version of pyTelegramBotAPI, please update your dependency usage to use the wider versioning options.
Thanks!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.