Skip to content

Commit 3672fa9

Browse files
committed
fix(proxy): log block_requests_for_models_without_pricing updates lazily
The eager f-strings tripped tests/test_litellm/test_logging.py::test_logging_calls_do_not_build_their_message_eagerly.
1 parent 2b2d6d7 commit 3672fa9

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

litellm/proxy/management_endpoints/cost_tracking_settings.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -497,11 +497,11 @@ async def update_block_requests_for_models_without_pricing(
497497
await proxy_config.save_config(new_config=config)
498498

499499
litellm.block_requests_for_models_without_pricing = request.enabled
500-
verbose_proxy_logger.info(f"Updated block_requests_for_models_without_pricing: {request.enabled}")
500+
verbose_proxy_logger.info("Updated block_requests_for_models_without_pricing: %s", request.enabled)
501501

502502
return BlockUnpricedModelsResponse(enabled=request.enabled)
503503
except Exception as e: # noqa: BLE001 # any config persistence failure must surface as a 500 response, not a crash
504-
verbose_proxy_logger.error(f"Error updating block_requests_for_models_without_pricing: {e!s}")
504+
verbose_proxy_logger.error("Error updating block_requests_for_models_without_pricing: %s", e)
505505
raise HTTPException(
506506
status_code=500,
507507
detail={ # mutable-ok: HTTPException detail must be a plain mapping

0 commit comments

Comments
 (0)