Files
Launcher/core_lib/log/default.py
T
wei a93641b26d Update many files.
Add some description about this project, and now it has a simple UI (made with Qt)

If you don't specify the mode of (interface?) the UI. Launcher will show a crude window that lets you
 select a mode to start the (real) launcher.

Test version data fetching functions. Looks great.
2026-07-10 23:27:21 +08:00

23 lines
672 B
Python

import logging
import sys
from colorlog import ColoredFormatter
DEFAULT_FORMAT = '%(asctime)s:%(name)s:%(levelname)s: %(message)s'
DEFAULT_DATE_FORMAT = '%H:%M:%S'
def get_colorful_handler():
handler = logging.StreamHandler(sys.stdout)
formatter = ColoredFormatter(
'%(light_white)s%(asctime)s:%(light_green)s%(name)s:%(log_color)s%(levelname)s%(reset)s: %(message)s',
log_colors={
'DEBUG': 'cyan',
'INFO': 'green',
'WARNING': 'yellow',
'ERROR': 'light_red',
'CRITICAL': 'red',
},
datefmt=DEFAULT_DATE_FORMAT
)
handler.setFormatter(formatter)
return handler