mirror of
https://github.com/inventree/InvenTree.git
synced 2025-11-13 11:26:42 +00:00
Reduce log output for Pint library (#10803)
- Reduce clutter in app startup due to unit redefinition
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
"""Helper functions for converting between units."""
|
"""Helper functions for converting between units."""
|
||||||
|
|
||||||
|
import logging
|
||||||
import re
|
import re
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
|
||||||
@@ -14,6 +15,9 @@ import structlog
|
|||||||
|
|
||||||
logger = structlog.get_logger('inventree')
|
logger = structlog.get_logger('inventree')
|
||||||
|
|
||||||
|
# Disable log output for Pint library
|
||||||
|
logging.getLogger('pint').setLevel(logging.ERROR)
|
||||||
|
|
||||||
|
|
||||||
def get_unit_registry():
|
def get_unit_registry():
|
||||||
"""Return a custom instance of the Pint UnitRegistry."""
|
"""Return a custom instance of the Pint UnitRegistry."""
|
||||||
|
|||||||
Reference in New Issue
Block a user