import logging

from circleguard.circleguard import Circleguard, set_options
from circleguard.replay import Check, Replay, ReplayMap, ReplayPath
from circleguard.enums import Detect, RatelimitWeight
from circleguard.utils import TRACE, ColoredFormatter
from circleguard.loader import Loader
from circleguard.exceptions import (CircleguardException, InvalidArgumentsException, APIException,
        NoInfoAvailableException, UnknownAPIException, InternalAPIException, InvalidKeyException, RatelimitException,
        InvalidJSONException, ReplayUnavailableException)
from circleguard.version import __version__

logging.addLevelName(TRACE, "TRACE")
formatter = ColoredFormatter("[%(threadName)s][%(name)s][%(levelname)s]  %(message)s  (%(filename)s:%(lineno)s)")
handler_stream = logging.StreamHandler()
handler_stream.setFormatter(formatter)
logging.getLogger("circleguard").addHandler(handler_stream)

__all__ = ["Circleguard", "set_options", "Check", "Replay", "ReplayMap",
           "ReplayPath", "Detect", "TRACE", "ColoredFormatter", "Loader",
           "__version__", "RatelimitWeight", "CircleguardException", "InvalidArgumentsException",
           "APIException", "NoInfoAvailableException", "UnknownAPIException", "InternalAPIException",
           "InvalidKeyException", "RatelimitException", "InvalidJSONException", "ReplayUnavailableException"]
