1
0
mirror of https://github.com/otter18/tg_logger.git synced 2025-08-04 21:32:56 +02:00

README.md fix

This commit is contained in:
ChernV
2021-11-06 18:04:41 +03:00
parent 91e2d68f86
commit ce7560ef22

View File

@ -1,33 +1,39 @@
# ![tg_logo](https://raw.githubusercontent.com/otter18/tg_logger/master/img/telegram-icon.png) Telegram logger [![GitHub Repo stars](https://img.shields.io/github/stars/otter18/tg_logger?style=social)](https://github.com/otter18/tg_logger/stargazers)
[![](https://img.shields.io/pypi/v/tg-logger.svg)](https://pypi.org/project/tg-logger/)
[![](https://img.shields.io/pypi/pyversions/tg-logger.svg)](https://pypi.org/project/tg-logger/)
[![Pypi version](https://img.shields.io/pypi/v/tg-logger.svg)](https://pypi.org/project/tg-logger/)
[![Downloads](https://static.pepy.tech/personalized-badge/tg-logger?period=total&units=international_system&left_color=grey&right_color=orange&left_text=Downloads)](https://pepy.tech/project/tg-logger)
[![GitHub](https://img.shields.io/github/license/otter18/tg_logger)](https://github.com/otter18/tg_logger/blob/main/LICENSE)
[![Documentation Status](https://readthedocs.org/projects/tg-logger/badge/?version=latest)](https://tg-logger.readthedocs.io/en/latest/?badge=latest)
<!-- [![Pyversions](https://img.shields.io/pypi/pyversions/tg-logger.svg)](https://pypi.org/project/tg-logger/) -->
Bridging python logging and files to tg bot
Documentation is available at [Read the Docs](https://tg-logger.readthedocs.io/)
## Table of Contents
- [Installation & Usage](#installation--usage)
- [Screenshot](#screenshot)
- [Examples](#examples)
Demo is available [@tg_logger_demo_bot](https://t.me/tg_logger_demo_bot), [[repo](https://github.com/otter18/tg-logger-demo-bot)]
![intro_img](https://raw.githubusercontent.com/otter18/tg_logger/main/img/intro.jpeg)
## 🗂 Table of Contents
- [Installation & Usage](#-installation--usage)
- [Screenshot](#-screenshot)
- [Examples](#-examples)
* [Simple logging](#simple-logging)
* [Flask logging](#flask-logging)
* [Setting extra parameters to handler](#setting-extra-parameters-to-handler)
* [TgFileLogger example](#tgfilelogger-example)
- [FQA](#fqa)
- [FQA](#-fqa)
* [How to create a telegram bot?](#how-to-create-a-telegram-bot)
* [How to get **token** and **user_id**?](#how-to-get-token-and-user_id)
## Installation & Usage
## 🚀 Installation & Usage
- Available by `pip install tg-logger`
- Use with `import tg_logger`
## Screenshot
## 📱 Screenshot
![example_scr](https://raw.githubusercontent.com/otter18/tg_logger/master/img/example_scr.png)
## Examples
## 📖 Examples
### Simple logging
```python
import logging
@ -51,6 +57,7 @@ logger.info("Hello from tg_logger by otter18")
### Flask logging
```python
from flask import Flask
import logging
import tg_logger
# Telegram data
@ -120,9 +127,11 @@ with open(file_name, 'w') as example_file:
tg_files_logger.send(file_name, "Test file")
```
## FQA
## 🔎 FQA
### How to create a telegram bot?
- To create bot use official [BotFather](https://t.me/BotFather) bot (descibed [here](https://core.telegram.org/bots#6-botfather))
### How to get **token** and **user_id**?
- Use [@tg_logger_demo_bot](https://t.me/tg_logger_demo_bot) with command `/id`
- Bot's **token** is shown after new bot is made
- To get **user_id** use special bots (e.g. [@userinfobot](https://t.me/userinfobot), [@JsonDumpBot](https://t.me/JsonDumpBot))