[Bugfix] Fix print_warning_once's line info (#8867)

This commit is contained in:
Tyler Michael Smith 2024-09-26 19:18:26 -04:00 committed by GitHub
parent b28d2104de
commit e2f6f26e86
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -744,7 +744,8 @@ def create_kv_caches_with_random(
@lru_cache
def print_warning_once(msg: str) -> None:
logger.warning(msg)
# Set the stacklevel to 2 to print the caller's line info
logger.warning(msg, stacklevel=2)
@lru_cache(maxsize=None)