feat: reduce log verbosity by changing info logs to debug

Changed logging level from INFO to DEBUG for performance-related messages in model management service. This reduces noise in production logs while maintaining debugging capability for performance analysis.
This commit is contained in:
Will Miao
2025-12-31 16:14:24 +08:00
parent 102defe29c
commit afa5533145
4 changed files with 4 additions and 4 deletions

View File

@@ -177,7 +177,7 @@ class ModelListingHandler:
format_duration = time.perf_counter() - format_start format_duration = time.perf_counter() - format_start
duration = time.perf_counter() - start_time duration = time.perf_counter() - start_time
self._logger.info( self._logger.debug(
"Request for %s/list took %.3fs (formatting: %.3fs)", "Request for %s/list took %.3fs (formatting: %.3fs)",
self._service.model_type, duration, format_duration self._service.model_type, duration, format_duration
) )

View File

@@ -151,7 +151,7 @@ class BaseModelService(ABC):
annotate_duration = time.perf_counter() - t4 annotate_duration = time.perf_counter() - t4
overall_duration = time.perf_counter() - overall_start overall_duration = time.perf_counter() - overall_start
logger.info( logger.debug(
"%s.get_paginated_data took %.3fs (fetch: %.3fs, filter: %.3fs, update_filter: %.3fs, pagination: %.3fs, annotate: %.3fs). " "%s.get_paginated_data took %.3fs (fetch: %.3fs, filter: %.3fs, update_filter: %.3fs, pagination: %.3fs, annotate: %.3fs). "
"Counts: initial=%d, post_filter=%d, final=%d", "Counts: initial=%d, post_filter=%d, final=%d",
self.__class__.__name__, overall_duration, fetch_duration, filter_duration, self.__class__.__name__, overall_duration, fetch_duration, filter_duration,

View File

@@ -258,7 +258,7 @@ class ModelCache:
duration = time.perf_counter() - start_time duration = time.perf_counter() - start_time
if duration > 0.05: if duration > 0.05:
logger.info("ModelCache._sort_data(%s, %s) for %d items took %.3fs", sort_key, order, len(data), duration) logger.debug("ModelCache._sort_data(%s, %s) for %d items took %.3fs", sort_key, order, len(data), duration)
return result return result
async def get_sorted_data(self, sort_key: str = 'name', order: str = 'asc') -> List[Dict]: async def get_sorted_data(self, sort_key: str = 'name', order: str = 'asc') -> List[Dict]:

View File

@@ -224,7 +224,7 @@ class ModelFilterSet:
duration = time.perf_counter() - overall_start duration = time.perf_counter() - overall_start
if duration > 0.1: # Only log if it's potentially slow if duration > 0.1: # Only log if it's potentially slow
logger.info( logger.debug(
"ModelFilterSet.apply took %.3fs (sfw: %.3fs, fav: %.3fs, folder: %.3fs, base: %.3fs, tags: %.3fs, types: %.3fs). " "ModelFilterSet.apply took %.3fs (sfw: %.3fs, fav: %.3fs, folder: %.3fs, base: %.3fs, tags: %.3fs, types: %.3fs). "
"Count: %d -> %d", "Count: %d -> %d",
duration, sfw_duration, favorites_duration, folder_duration, duration, sfw_duration, favorites_duration, folder_duration,