0.4.10-a
All checks were successful
Deploy on push / deploy (push) Successful in 44s

This commit is contained in:
2025-02-11 12:00:35 +03:00
parent 25b61c6b29
commit 5d87035885
27 changed files with 299 additions and 536 deletions

View File

@@ -6,17 +6,26 @@ import colorlog
_lib_path = Path(__file__).parents[1]
_leng_path = len(_lib_path.as_posix())
def filter(record: logging.LogRecord):
# Define `package` attribute with the relative path.
record.package = record.pathname[_leng_path+1:].replace(".py", "")
record.emoji = "🔍" if record.levelno == logging.DEBUG \
else "🖊️" if record.levelno == logging.INFO \
else "🚧" if record.levelno == logging.WARNING \
else "" if record.levelno == logging.ERROR \
else "🧨" if record.levelno == logging.CRITICAL \
record.package = record.pathname[_leng_path + 1 :].replace(".py", "")
record.emoji = (
"🔍"
if record.levelno == logging.DEBUG
else "🖊️"
if record.levelno == logging.INFO
else "🚧"
if record.levelno == logging.WARNING
else ""
if record.levelno == logging.ERROR
else "🧨"
if record.levelno == logging.CRITICAL
else ""
)
return record
# Define the color scheme
color_scheme = {
"DEBUG": "light_black",
@@ -55,9 +64,9 @@ class MultilineColoredFormatter(colorlog.ColoredFormatter):
def format(self, record):
# Add default emoji if not present
if not hasattr(record, 'emoji'):
if not hasattr(record, "emoji"):
record = filter(record)
message = record.getMessage()
if "\n" in message:
lines = message.split("\n")