docs: add code style guide in English, Japanese, and Chinese

This commit is contained in:
Junyan Qin
2025-12-29 23:50:10 +08:00
parent de5660ddc4
commit 08bcce19db
4 changed files with 48 additions and 0 deletions
+15
View File
@@ -0,0 +1,15 @@
# 代码规范指南
## 日志记录
在插件中请使用`logging`模块记录日志,不要使用`print`语句(这将导致容器环境中无法输出日志)。
```python
import logging
logger = logging.getLogger(__name__) # 在任何 Python 文件的开头导入 logging 模块,并定义 logger 对象
logger.info('This is an info message') # 使用 logger.info 记录信息级别日志
logger.warning('This is a warning message')
logger.error('This is an error message')
```