Tweak logging to increase the space available by 3 characters

This commit is contained in:
cmdr2 2022-12-11 13:19:22 +05:30
parent a2af811ad2
commit 543f13f9a3
3 changed files with 6 additions and 4 deletions

View File

@ -8,12 +8,12 @@ from rich.logging import RichHandler
from sd_internal import task_manager from sd_internal import task_manager
LOG_FORMAT = '%(levelname)s %(threadName)s %(message)s' LOG_FORMAT = '%(asctime)s.%(msecs)03d %(levelname)s %(threadName)s %(message)s'
logging.basicConfig( logging.basicConfig(
level=logging.INFO, level=logging.INFO,
format=LOG_FORMAT, format=LOG_FORMAT,
datefmt="%X.%f", datefmt="%X",
handlers=[RichHandler(markup=True, rich_tracebacks=True, show_level=False)] handlers=[RichHandler(markup=True, rich_tracebacks=True, show_time=False, show_level=False)]
) )
log = logging.getLogger() log = logging.getLogger()

View File

@ -149,7 +149,7 @@ def getModels():
listModels(model_type='vae') listModels(model_type='vae')
listModels(model_type='hypernetwork') listModels(model_type='hypernetwork')
if models_scanned > 0: log.info(f'[green]Scanned {models_scanned} models. 0 infected[/]') if models_scanned > 0: log.info(f'[green]Scanned {models_scanned} models. Nothing infected[/]')
# legacy # legacy
custom_weight_path = os.path.join(app.SD_DIR, 'custom-model.ckpt') custom_weight_path = os.path.join(app.SD_DIR, 'custom-model.ckpt')

View File

@ -5,6 +5,7 @@ Notes:
import os import os
import traceback import traceback
import logging import logging
import datetime
from typing import List, Union from typing import List, Union
from fastapi import FastAPI, HTTPException from fastapi import FastAPI, HTTPException
@ -17,6 +18,7 @@ from sd_internal import app, model_manager, task_manager
log = logging.getLogger() log = logging.getLogger()
log.info(f'started in {app.SD_DIR}') log.info(f'started in {app.SD_DIR}')
log.info(f'started at {datetime.datetime.now():%x %X}')
server_api = FastAPI() server_api = FastAPI()