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:
31
README.md
31
README.md
@ -1,33 +1,39 @@
|
|||||||
#  Telegram logger [](https://github.com/otter18/tg_logger/stargazers)
|
#  Telegram logger [](https://github.com/otter18/tg_logger/stargazers)
|
||||||
[](https://pypi.org/project/tg-logger/)
|
[](https://pypi.org/project/tg-logger/)
|
||||||
[](https://pypi.org/project/tg-logger/)
|
[](https://pepy.tech/project/tg-logger)
|
||||||
[](https://github.com/otter18/tg_logger/blob/main/LICENSE)
|
[](https://github.com/otter18/tg_logger/blob/main/LICENSE)
|
||||||
[](https://tg-logger.readthedocs.io/en/latest/?badge=latest)
|
[](https://tg-logger.readthedocs.io/en/latest/?badge=latest)
|
||||||
|
|
||||||
|
<!-- [](https://pypi.org/project/tg-logger/) -->
|
||||||
|
|
||||||
Bridging python logging and files to tg bot
|
Bridging python logging and files to tg bot
|
||||||
|
|
||||||
Documentation is available at [Read the Docs](https://tg-logger.readthedocs.io/)
|
Documentation is available at [Read the Docs](https://tg-logger.readthedocs.io/)
|
||||||
|
|
||||||
## Table of Contents
|
Demo is available [@tg_logger_demo_bot](https://t.me/tg_logger_demo_bot), [[repo](https://github.com/otter18/tg-logger-demo-bot)]
|
||||||
- [Installation & Usage](#installation--usage)
|
|
||||||
- [Screenshot](#screenshot)
|

|
||||||
- [Examples](#examples)
|
|
||||||
|
## 🗂 Table of Contents
|
||||||
|
- [Installation & Usage](#-installation--usage)
|
||||||
|
- [Screenshot](#-screenshot)
|
||||||
|
- [Examples](#-examples)
|
||||||
* [Simple logging](#simple-logging)
|
* [Simple logging](#simple-logging)
|
||||||
* [Flask logging](#flask-logging)
|
* [Flask logging](#flask-logging)
|
||||||
* [Setting extra parameters to handler](#setting-extra-parameters-to-handler)
|
* [Setting extra parameters to handler](#setting-extra-parameters-to-handler)
|
||||||
* [TgFileLogger example](#tgfilelogger-example)
|
* [TgFileLogger example](#tgfilelogger-example)
|
||||||
- [FQA](#fqa)
|
- [FQA](#-fqa)
|
||||||
* [How to create a telegram bot?](#how-to-create-a-telegram-bot)
|
* [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)
|
* [How to get **token** and **user_id**?](#how-to-get-token-and-user_id)
|
||||||
|
|
||||||
## Installation & Usage
|
## 🚀 Installation & Usage
|
||||||
- Available by `pip install tg-logger`
|
- Available by `pip install tg-logger`
|
||||||
- Use with `import tg_logger`
|
- Use with `import tg_logger`
|
||||||
|
|
||||||
## Screenshot
|
## 📱 Screenshot
|
||||||

|

|
||||||
|
|
||||||
## Examples
|
## 📖 Examples
|
||||||
### Simple logging
|
### Simple logging
|
||||||
```python
|
```python
|
||||||
import logging
|
import logging
|
||||||
@ -51,6 +57,7 @@ logger.info("Hello from tg_logger by otter18")
|
|||||||
### Flask logging
|
### Flask logging
|
||||||
```python
|
```python
|
||||||
from flask import Flask
|
from flask import Flask
|
||||||
|
import logging
|
||||||
import tg_logger
|
import tg_logger
|
||||||
|
|
||||||
# Telegram data
|
# Telegram data
|
||||||
@ -120,9 +127,11 @@ with open(file_name, 'w') as example_file:
|
|||||||
tg_files_logger.send(file_name, "Test file")
|
tg_files_logger.send(file_name, "Test file")
|
||||||
```
|
```
|
||||||
|
|
||||||
## FQA
|
## 🔎 FQA
|
||||||
### How to create a telegram bot?
|
### 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))
|
- 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**?
|
### 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
|
- 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))
|
- To get **user_id** use special bots (e.g. [@userinfobot](https://t.me/userinfobot), [@JsonDumpBot](https://t.me/JsonDumpBot))
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user