🔖 Release 2.4.3
Some checks failed
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.10) (push) Failing after 16s
Ruff Lint / Ruff Lint (push) Successful in 33s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.12) (push) Failing after 41s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.9) (push) Failing after 1m13s
Pyright Lint / Pyright Lint (pydantic-v1) (push) Successful in 1m20s
Pyright Lint / Pyright Lint (pydantic-v2) (push) Failing after 1m39s
Site Deploy / publish (push) Failing after 1m45s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.9) (push) Failing after 2m3s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.11) (push) Failing after 2m45s
Code Coverage / Test Coverage (pydantic-v1, ubuntu-latest, 3.12) (push) Failing after 3m45s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.11) (push) Failing after 3m52s
Code Coverage / Test Coverage (pydantic-v2, ubuntu-latest, 3.10) (push) Failing after 3m56s
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, macos-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v1, windows-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, macos-latest, 3.9) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.10) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.11) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.12) (push) Has been cancelled
Code Coverage / Test Coverage (pydantic-v2, windows-latest, 3.9) (push) Has been cancelled

This commit is contained in:
noneflow[bot]
2025-08-07 10:13:49 +00:00
parent ec965fc705
commit 2b9f8c15f2
104 changed files with 21227 additions and 2 deletions

View File

@ -0,0 +1,73 @@
---
mdx:
format: md
sidebar_position: 7
description: nonebot.log 模块
---
# nonebot.log
本模块定义了 NoneBot 的日志记录 Logger。
NoneBot 使用 [`loguru`][loguru] 来记录日志信息。
自定义 logger 请参考 [自定义日志](https://nonebot.dev/docs/appendices/log)
以及 [`loguru`][loguru] 文档。
[loguru]: https://github.com/Delgan/loguru
## _var_ `logger` {#logger}
- **类型:** Logger
- **说明**
NoneBot 日志记录器对象。
默认信息:
- 格式: `[%(asctime)s %(name)s] %(levelname)s: %(message)s`
- 等级: `INFO` ,根据 `config.log_level` 配置改变
- 输出: 输出至 stdout
- **用法**
```python
from nonebot.log import logger
```
## _class_ `LoguruHandler(<auto>)` {#LoguruHandler}
- **说明:** logging 与 loguru 之间的桥梁,将 logging 的日志转发到 loguru。
- **参数**
auto
### _method_ `emit(record)` {#LoguruHandler-emit}
- **参数**
- `record` (logging.LogRecord)
- **返回**
- untyped
## _def_ `default_filter(record)` {#default-filter}
- **说明:** 默认的日志过滤器,根据 `config.log_level` 配置改变日志等级。
- **参数**
- `record` (Record)
- **返回**
- untyped
## _var_ `default_format` {#default-format}
- **类型:** str
- **说明:** 默认日志格式