mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-10-30 04:15:45 +08:00
docs: add code style guide in English, Japanese, and Chinese
This commit is contained in:
@@ -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 を使用して info レベルのログを記録します
|
||||
logger.warning('This is a warning message')
|
||||
logger.error('This is an error message')
|
||||
```
|
||||
Reference in New Issue
Block a user