- Introduced a new trading dashboard consisting of a FastAPI backend (`dashboard-api`) for data retrieval and a React frontend (`dashboard-ui`) for visualization. - Implemented a log parser to monitor and store bot logs in an SQLite database. - Configured Docker setup for both API and UI, including necessary Dockerfiles and a docker-compose configuration. - Added setup documentation for running the dashboard and accessing its features. - Enhanced the Jenkins pipeline to build and push the new dashboard images.
25 lines
569 B
Python
25 lines
569 B
Python
import sys
|
|
from loguru import logger
|
|
|
|
|
|
def setup_logger(log_level: str = "INFO"):
|
|
logger.remove()
|
|
logger.add(
|
|
sys.stdout,
|
|
format=(
|
|
"<green>{time:YYYY-MM-DD HH:mm:ss}</green> | "
|
|
"<level>{level: <8}</level> | "
|
|
"<cyan>{name}</cyan>:<cyan>{line}</cyan> - "
|
|
"<level>{message}</level>"
|
|
),
|
|
level=log_level,
|
|
colorize=True,
|
|
)
|
|
logger.add(
|
|
"logs/bot.log",
|
|
rotation="00:00",
|
|
retention="30 days",
|
|
level="DEBUG",
|
|
encoding="utf-8",
|
|
)
|