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