mirror of
https://github.com/PaiGramTeam/PamGram.git
synced 2024-11-22 06:17:54 +00:00
🎨 忽略除本项目外的其它日志
This commit is contained in:
parent
a524a869d3
commit
7cbe83df36
@ -186,6 +186,7 @@ class Bot:
|
||||
await self.start_services()
|
||||
logger.info('开始安装插件')
|
||||
await self.install_plugins()
|
||||
logger.info('BOT 初始化成功')
|
||||
|
||||
def launch(self) -> NoReturn:
|
||||
"""启动机器人"""
|
||||
@ -199,7 +200,6 @@ class Bot:
|
||||
.post_init(self._post_init)
|
||||
.build()
|
||||
)
|
||||
logger.info('BOT 初始化成功')
|
||||
try:
|
||||
for _ in range(5):
|
||||
try:
|
||||
|
@ -463,12 +463,16 @@ with _lock:
|
||||
FileHandler(level=40, path=config.logger.path.joinpath("error/error.log"))
|
||||
)
|
||||
|
||||
log_filter = logging.Filter('TGPaimon')
|
||||
handler.addFilter(log_filter)
|
||||
debug_handler.addFilter(log_filter)
|
||||
|
||||
level_ = 10 if config.debug else 20
|
||||
logging.basicConfig(
|
||||
level=10 if config.debug else 20,
|
||||
format="%(message)s",
|
||||
datefmt="[%Y-%m-%d %X]",
|
||||
handlers=[handler, debug_handler, error_handler]
|
||||
datefmt=config.logger.time_format,
|
||||
handlers=[handler, debug_handler, error_handler],
|
||||
)
|
||||
warnings_logger = logging.getLogger("py.warnings")
|
||||
warnings_logger.addHandler(handler)
|
||||
|
Loading…
Reference in New Issue
Block a user