Reduce log output for Pint library (#10803)

- Reduce clutter in app startup due to unit redefinition
This commit is contained in:
Oliver 2025-11-11 13:33:43 +11:00 committed by GitHub
parent 682dd79326
commit 246c084e6e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 4 additions and 0 deletions

View File

@ -1,5 +1,6 @@
"""Helper functions for converting between units."""
import logging
import re
from typing import Optional
@ -14,6 +15,9 @@ import structlog
logger = structlog.get_logger('inventree')
# Disable log output for Pint library
logging.getLogger('pint').setLevel(logging.ERROR)
def get_unit_registry():
"""Return a custom instance of the Pint UnitRegistry."""