Skip to content

Commit 41b07d3

Browse files
committed
refactor: add stacklevel=2 to jm_log compatibility warning
1 parent 4e00a32 commit 41b07d3

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/jmcomic/jm_config.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -422,7 +422,10 @@ def jm_log(cls, topic: str, msg: str, e: Exception = None):
422422
executor(topic, msg, e)
423423
else:
424424
import warnings
425-
warnings.warn('jmcomic已升级到标准logging,建议将EXECUTOR_LOG重新定义为3个参数以接收异常对象 (topic, msg, e)')
425+
warnings.warn(
426+
'jmcomic已升级到标准logging,建议将EXECUTOR_LOG重新定义为3个参数以接收异常对象 (topic, msg, e)',
427+
stacklevel=2
428+
)
426429
executor(topic, msg)
427430

428431
@classmethod

0 commit comments

Comments
 (0)