mirror of
https://github.com/Unstructured-IO/unstructured.git
synced 2025-09-02 21:33:08 +00:00

* add and config trace logger * chore: update loggers in partition * doc: changelog and version * doc: update changelog * doc: remove placeholder * chore: bypass mypy
19 lines
480 B
Python
19 lines
480 B
Python
import logging
|
|
|
|
logger = logging.getLogger("unstructured")
|
|
trace_logger = logging.getLogger("unstructured.trace")
|
|
|
|
# Create a custom logging level
|
|
DETAIL = 15
|
|
logging.addLevelName(DETAIL, "DETAIL")
|
|
|
|
|
|
# Create a custom log method for the "DETAIL" level
|
|
def detail(self, message, *args, **kws):
|
|
if self.isEnabledFor(DETAIL):
|
|
self._log(DETAIL, message, args, **kws)
|
|
|
|
|
|
# Add the custom log method to the logging.Logger class
|
|
logging.Logger.detail = detail # type: ignore
|