From 658f9ed9c662c6d8ac12e1a3ee7d9b2704f3aa4e Mon Sep 17 00:00:00 2001 From: SantaSpeen Date: Tue, 25 Jul 2023 21:19:13 +0300 Subject: [PATCH] Add some colors ^) --- requirements.txt | 3 ++- src/core/utils.py | 6 +++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/requirements.txt b/requirements.txt index b652ad6..3696d5c 100644 --- a/requirements.txt +++ b/requirements.txt @@ -7,4 +7,5 @@ starlette~=0.27.0 pydantic~=2.0.2 click~=8.1.4 lupa~=2.0 -toml~=0.10.2 \ No newline at end of file +toml~=0.10.2 +colorama~=0.4.6 \ No newline at end of file diff --git a/src/core/utils.py b/src/core/utils.py index b718744..1836d97 100644 --- a/src/core/utils.py +++ b/src/core/utils.py @@ -10,7 +10,11 @@ import logging import os import tarfile -log_format = "[%(asctime)s | %(name)-14s | %(levelname)-5s] %(message)s" +import colorama +from colorama import Fore, Style + +colorama.init() +log_format = f"{Fore.CYAN}[%(asctime)s | %(name)-14s | %(levelname)-5s] {Style.RESET_ALL} %(message)s" log_dir = "./logs/" log_file = log_dir + "server.log" log_level = logging.INFO