{ "info": { "author": "NickSablukov", "author_email": "dessanndes@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Software Development :: Debuggers", "Topic :: System :: Logging" ], "description": "python-telegram-handler-proxy\n***********************\n\nOriginal package https://github.com/sashgorokhov/python-telegram-handler\nThank you bro \\m/\n\nInstallation\n============\n\nVia pip:\n\n.. code-block:: shell\n\n pip install python-telegram-handler-proxy\n\nUsage\n=====\n\nRegister a new telegram bot and obtain a ``authentication token``. (Instructions here https://core.telegram.org/bots#3-how-do-i-create-a-bot)\n\nAfter that, you must obtain a ``chat_id``. You can do that using included simple script. Start a new conversation with newly created bot, write something to it (it is important to initiate conversation first).\n\nAlso, there is an ability for handler to automatically retrieve ``chat_id``. This will be done on handler initialization. But you still have to start a conversation with bot. Be aware: if program stops, server restarts, or something else will happen - handler will try to retrieve chat id from telegram, and may fail, if it will not find a NEW message from you. So i recommend you to use a script below for obtaining chat id. \n\nThen run a command:\n\n.. code-block:: shell\n\n python -m telegram_handler_proxy \n \nIf all went ok, a ``chat_id`` will be printed to stdout.\n\nUsing ``token`` and ``chat_id``, configure log handler in your desired way.\nFor example, using dictConfig:\n\n.. code-block:: python\n\n {\n 'version': 1,\n 'handlers': {\n 'telegram': {\n 'class': 'telegram_handler_proxy.TelegramHandler',\n 'token': 'your token',\n 'chat_id': 'chat id',\n 'proxy_url': 'url',\n 'proxy_port': None\n }\n },\n 'loggers': {\n 'my_logger': {\n 'handlers': ['telegram'],\n 'level': 'DEBUG'\n }\n }\n }\n\nFormatting\n==========\n\nCurrently the format of sent messages is very simple: ``%(asctime)s %(levelname)s\\nFrom %(name)s:%(funcName)s\\n%(message)s``\nException traceback will be formatted as pre-formatted fixed-width code block. (https://core.telegram.org/bots/api#html-style)\n\nIf you want to tweak it, configure a ``telegram_handler_proxy.HtmlFormatter`` with your desired format string.\nUsing a dictConfig:\n\n.. code-block:: python\n \n ...\n {\n 'formatters': {\n 'telegram': {\n 'class': 'telegram_handler_proxy.HtmlFormatter',\n 'fmt': '%(levelname)s %(message)s'\n }\n }\n 'handlers': {\n 'telegram': {\n 'class': 'telegram_handler_proxy.TelegramHandler',\n 'formatter': 'telegram',\n 'token': 'your token',\n 'chat_id': 'chat id',\n 'proxy_url': 'url',\n 'proxy_port': None\n }\n }\n }\n ...\n\nIf you wish, you can enable emoji symbols in HtmlFormatter. Just specify `use_emoji=True` in HtmlFormatter settings.\nThis will add to levelname a :white_circle: for DEBUG, :large_blue_circle: for INFO, and :red_circle: for WARNING and ERROR levels. \n\n\n.. :changelog:\n\nHistory\n-------\n\n2.0.2 (2017-11-20)\n++++++++++++++++++\n\n* fix TypeError in HtmlFormatter.format (by tompipen)\n\n\n2.0 (2017-03-01)\n++++++++++++++++\n\n* Refactored HtmlFormatter and MarkdownFormatter\n* Refactored TelegramHandler\n* No more need to call a command to obtain a chat_id - it will be obtained automatically on handler init\n* Rewritten tests\n* Escape LogRecord things in HtmlFormatter\n* Added optional emoji symbols in HtmlFormatter.\n\n1.1.3 (2016-09-22)\n++++++++++++++++++\n\n* Setting escape_message field of StyledFormatter missed (@ihoru)\n\n1.1.2 (2016-05-13)\n++++++++++++++++++\n\n* Fixed setup.py requires option (changed to install_requires)\n\n1.1.1 (2016-04-20)\n++++++++++++++++++\n\n* Use HTML Formatter as default formatter for telegram handler\n\n1.1.0 (2016-04-20)\n++++++++++++++++++\n\n* Introduced HTML Formatter\n* Added log text escaping (closed #3)\n* Added requests timeout setting (closed #1)\n* Catching and logging all requests and their exceptions (closed #2)\n\n1.0.0 (2016-04-19)\n++++++++++++++++++\n\n* First PyPi release\n\n0.1.0 (2016-04-19)\n++++++++++++++++++\n\n* Initial release", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "", "keywords": "telegram", "license": "MIT License", "maintainer": "", "maintainer_email": "", "name": "python-telegram-handler-proxy", "package_url": "https://pypi.org/project/python-telegram-handler-proxy/", "platform": "", "project_url": "https://pypi.org/project/python-telegram-handler-proxy/", "project_urls": null, "release_url": "https://pypi.org/project/python-telegram-handler-proxy/1.0.2/", "requires_dist": null, "requires_python": "", "summary": "Fork a python logging handler that sends logs via Telegram Bot Api with proxy", "version": "1.0.2" }, "last_serial": 3769830, "releases": { "1.0.1": [ { "comment_text": "", "digests": { "md5": "264a419a56d8e0968bde9804e2c00426", "sha256": "75c4eaf411695b70a585eb060602e91dad80e0c1cc00122913fe32368da1701f" }, "downloads": -1, "filename": "python-telegram-handler-proxy-1.0.1.tar.gz", "has_sig": false, "md5_digest": "264a419a56d8e0968bde9804e2c00426", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4960, "upload_time": "2018-04-16T16:13:55", "url": "https://files.pythonhosted.org/packages/b2/13/87f5c4429366cb15ab5a4f32a6c48cdfc82f5df969e7df59efbc38d67bb5/python-telegram-handler-proxy-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "9557987e2fd0a09f81cba0fe3c2c6563", "sha256": "d9fbbb14dfdf0d0bdee3f7442a55fc740c36ff339a5ebb52fac9cd5522c4bd02" }, "downloads": -1, "filename": "python-telegram-handler-proxy-1.0.2.tar.gz", "has_sig": false, "md5_digest": "9557987e2fd0a09f81cba0fe3c2c6563", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4951, "upload_time": "2018-04-16T16:56:22", "url": "https://files.pythonhosted.org/packages/43/23/864425024705dca661aeb0eaf4607355f82c219bf71c746b6d1402726599/python-telegram-handler-proxy-1.0.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "9557987e2fd0a09f81cba0fe3c2c6563", "sha256": "d9fbbb14dfdf0d0bdee3f7442a55fc740c36ff339a5ebb52fac9cd5522c4bd02" }, "downloads": -1, "filename": "python-telegram-handler-proxy-1.0.2.tar.gz", "has_sig": false, "md5_digest": "9557987e2fd0a09f81cba0fe3c2c6563", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4951, "upload_time": "2018-04-16T16:56:22", "url": "https://files.pythonhosted.org/packages/43/23/864425024705dca661aeb0eaf4607355f82c219bf71c746b6d1402726599/python-telegram-handler-proxy-1.0.2.tar.gz" } ] }