mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-10-29 20:05:25 +08:00
* 重构文档结构:移除 docs 目录,调整文件组织结构 * Reorder "插件 SDK API" section in docs.json * Refactor and clarify various documentation sections * Refine warnings and info boxes across multiple docs * Refactor and simplify Japanese documentation content * Update package.json to include mintlify as a dependency and add pnpm-lock.yaml for dependency management * Update blog link and add description in docs.json --------- Co-authored-by: Junyan Chin <[email protected]>
18 lines
689 B
Plaintext
18 lines
689 B
Plaintext
---
|
|
title: "コードスタイルガイド"
|
|
---
|
|
|
|
## ロギング
|
|
|
|
プラグインでは、`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')
|
|
```
|