feat: add configurable logging level for backend and Mini App
- Introduced a new `LOG_LEVEL` configuration option in the `.env.example` file to allow users to set the logging level (DEBUG, INFO, WARNING, ERROR). - Updated the `Settings` class to include the `log_level` attribute, normalizing its value to ensure valid logging levels are used. - Modified the logging setup in `run.py` to utilize the configured log level, enhancing flexibility in log management. - Enhanced the Mini App to include the logging level in the JavaScript configuration, allowing for consistent logging behavior across the application. - Added a new `logger.js` module for frontend logging, implementing level-based filtering and console delegation. - Included unit tests for the new logger functionality to ensure proper behavior and level handling.
This commit is contained in:
@@ -26,6 +26,9 @@ ADMIN_USERNAMES=admin1,admin2
|
||||
# When the pinned duty message is updated on schedule, re-pin so members get a notification (default: 1). Set to 0 or false to disable.
|
||||
# DUTY_PIN_NOTIFY=1
|
||||
|
||||
# Log level for backend and Mini App console logs: DEBUG, INFO, WARNING, ERROR. Default: INFO.
|
||||
# LOG_LEVEL=INFO
|
||||
|
||||
# Single source of language for bot, API, and Mini App (en or ru). Default: en. No auto-detection.
|
||||
# DEFAULT_LANGUAGE=en
|
||||
|
||||
|
||||
Reference in New Issue
Block a user