mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-10-31 04:45:23 +08:00
15 lines
515 B
Markdown
15 lines
515 B
Markdown
# Code Style Guide
|
|
|
|
## Logging
|
|
|
|
In plugins, please use the `logging` module to record logs, do not use `print` statements (this will cause logs to not be output in the container environment).
|
|
|
|
```python
|
|
import logging
|
|
|
|
logger = logging.getLogger(__name__) # Import logging module at the beginning of any Python file and define logger object
|
|
|
|
logger.info('This is an info message') # Use logger.info to record info level logs
|
|
logger.warning('This is a warning message')
|
|
logger.error('This is an error message')
|
|
``` |