mirror of
https://github.com/PaiGramTeam/paigram-logger.git
synced 2024-11-27 10:10:28 +00:00
42 lines
7.7 KiB
Markdown
42 lines
7.7 KiB
Markdown
# paigram-logger
|
|
A logger for PaiGram's projects.
|
|
|
|
[![Python 3.8](https://img.shields.io/badge/Python-3.8_|_3.9_|_3.10_|_3.11-blue?style=flat-square&logo=python&logoColor=white)](https://www.python.org/downloads/release/python-380/)
|
|
[![GitHub file size in bytes](https://img.shields.io/github/repo-size/PaiGramTeam/paigram-logger?label=Size&logo=hack-the-box&logoColor=white&style=flat-square)](https://github.com/PaiGramTeam/paigram-logger/)
|
|
[![PyPI](https://img.shields.io/pypi/v/paigram-logger?color=%233775A9&label=PyPI&logo=pypi&logoColor=white&style=flat-square)](https://pypi.org/project/paigram-logger/)
|
|
|
|
[![License](https://img.shields.io/github/license/PaiGramTeam/paigram-logger?label=License&style=flat-square&logo=data:image/svg+xml;base64,PHN2ZyB0PSIxNjUxMjEyODQ2ODY0IiBjbGFzcz0iaWNvbiIgdmlld0JveD0iMCAwIDEwMjQgMTAyNCIgdmVyc2lvbj0iMS4xIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHAtaWQ9IjE1MDAiIHdpZHRoPSIzMDAiIGhlaWdodD0iMzAwIj48cGF0aCBkPSJNOTQ3LjIgOTIxLjZsLTg3MC40IDBjLTQyLjM0MjQgMC03Ni44LTM0LjQ1NzYtNzYuOC03Ni44bDAtNjY1LjZjMC00Mi4zNDI0IDM0LjQ1NzYtNzYuOCA3Ni44LTc2LjhsODcwLjQgMGM0Mi4zNDI0IDAgNzYuOCAzNC40NTc2IDc2LjggNzYuOGwwIDY2NS42YzAgNDIuMzQyNC0zNC40NTc2IDc2LjgtNzYuOCA3Ni44ek03Ni44IDE1My42Yy0xNC4xMzEyIDAtMjUuNiAxMS40Njg4LTI1LjYgMjUuNmwwIDY2NS42YzAgMTQuMTMxMiAxMS40Njg4IDI1LjYgMjUuNiAyNS42bDg3MC40IDBjM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wLjEwMjQtMi40MDY0bDYuNzU4NC0yMC43ODcyIDQxLjYyNTYtMzAuMjU5Mi0xNS45MjMyLTQ4Ljk0NzIgMTUuOTIzMi00OC45NDcyek02NzcuNTI5NiAzNTQuNjExMmwyNC45ODU2LTE4LjE3NiA5LjU3NDQtMjkuMzg4OCAzMC45MjQ4IDAgMjQuOTg1Ni0xOC4xNzYgMjQuOTg1NiAxOC4xNzYgMzAuOTI0OCAwIDkuNTc0NCAyOS4zODg4IDI0Ljk4NTYgMTguMTc2LTkuNTc0NCAyOS4zODg4IDkuNTc0NCAyOS4zODg4LTI0Ljk4NTYgMTguMTc2LTkuNTc0NCAyOS4zODg4LTMwLjkyNDggMC0yNC45ODU2IDE4LjE3Ni0yNC45ODU2LTE4LjE3Ni0zMC45MjQ4IDAtOS41NzQ0LTI5LjM4ODgtMjQuOTg1Ni0xOC4xNzYgOS41NzQ0LTI5LjM4ODgtOS41NzQ0LTI5LjM4ODh6TTc4Ni4xMjQ4IDY0Ny40NzUyYy05Ljk4NC05Ljk4NC0yNi4yMTQ0LTkuOTg0LTM2LjE5ODQgMGwtMzMuMDc1MiAzMy4wNzUyIDAtMTY4LjQ0OCA5LjU3NDQgMCA0MS42MjU2IDMwLjI1OTIgNDEuNjI1Ni0zMC4yNTkyIDkuNTc0NCAwIDAgMTY4LjQ0OC0zMy4wNzUyLTMzLjA3NTJ6IiBwLWlkPSIxNTA3IiBmaWxsPSIjZmZmZmZmIj48L3BhdGg+PC9zdmc+)](./LICENSE)
|
|
[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/PaigramTeam/paigram-logger/publish.yml?label=Build&logo=github-actions&logoColor=white&style=flat-square)](https://github.com/PaiGramTeam/paigram-logger/actions/workflows/publish.yml)
|
|
[![View](https://img.shields.io/badge/dynamic/json?color=7AA3CC&label=View&query=%24.value&url=https%3A%2F%2Fapi.countapi.xyz%2Fhit%2FPaiGramTeam%2Fpaigram-logger&style=flat-square&logo=data:image/svg+xml;base64,PHN2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jEuMTMxMTM3IDYyLjg2NTI4MSA2NTUuNTA5NDg1IDE4OC4yOTgwNjIgNjU1LjUwOTQ4NSAxODguMjk4MDYyIDg1OS4yNDI1ODYgODMyLjE2MDI3NSA4NTkuMjQyNTg2IDgzMi4xNjAyNzUgNjU1LjUwOTQ4NSA5NTcuNTQzOTM3IDY1NS41MDk0ODVaIiBwLWlkPSI1MTYzIiBmaWxsPSIjZmZmZmZmIj48L3BhdGg%2BPHBhdGggZD0iTTc1My4yNzg3MTcgMzYzLjI3ODgxNyA1MTAuMTgwMDUgNzkwLjc0MTQ0NSAyNjcuMDMzMjg3IDM2My4yNzg4MTdaIiBwLWlkPSI1MTY0IiBmaWxsPSIjZmZmZmZmIj48L3BhdGg%2BPHBhdGggZD0iTTQzNC44OTEzMiA2NC4zNTY3NWwxNTAuNTI4MzQyIDAgMCAzMDAuMjU5NTI4LTE1MC41MjgzNDIgMCAwLTMwMC4yNTk1MjhaIiBwLWlkPSI1MTY1IiBmaWxsPSIjZmZmZmZmIj48L3BhdGg%2BPC9zdmc%2B&style=flat-square)](https://pypi.org/project/paigram-logger/))
|
|
|
|
## 使用方法
|
|
|
|
### 使用默认配置
|
|
|
|
```python
|
|
from pg_logger import Logger
|
|
|
|
logger = Logger()
|
|
|
|
logger.info("info log")
|
|
logger.success("success log")
|
|
```
|
|
|
|
### 自定义配置 Logger
|
|
|
|
```python
|
|
from pg_logger import Logger, LoggerConfig
|
|
|
|
logger = Logger(
|
|
LoggerConfig(
|
|
width=120,
|
|
keywords=['GET', 'PUT', 'POST']
|
|
)
|
|
)
|
|
|
|
logger.info("[GET] info log")
|
|
logger.success("[PUT] success log")
|
|
|
|
``` |