import logging
from .accqsure import AccQsure
from .enums import (
    MIME_TYPE,
    INSPECTION_TYPE,
    CHART_SECTION_STYLE,
    CHART_ELEMENT_TYPE,
)
from .util import DocumentContents

TRACE = 5
logging.addLevelName(TRACE, "TRACE")


# Create a custom logger class or function to support TRACE
def trace(self, message, *args, **kwargs):
    if self.isEnabledFor(TRACE):
        self._log(TRACE, message, args, **kwargs)


logging.Logger.trace = trace

logging.basicConfig(
    format="%(asctime)s.%(msecs)03dZ  %(levelname)s  %(message)s",
    datefmt="%Y-%m-%dT%H:%M:%S",
    level=logging.INFO,
)
logger = logging.getLogger(__name__)
logger.propagate = False

__version__ = "0.3.1"
__all__ = (
    "AccQsure",
    "MIME_TYPE",
    "INSPECTION_TYPE",
    "CHART_SECTION_STYLE",
    "CHART_ELEMENT_TYPE",
    "DocumentContents",
)
