# Path: xpathwebdriver/ColorStreamHandler.py
# class _AnsiColorStreamHandler(logging.StreamHandler):
# class _WinColorStreamHandler(logging.StreamHandler):
#     DEFAULT = '\x1b[0m'
#     RED     = '\x1b[31m'
#     GREEN   = '\x1b[32m'
#     YELLOW  = '\x1b[33m'
#     CYAN    = '\x1b[36m'
#     CRITICAL = RED
#     ERROR    = RED
#     WARNING  = YELLOW
#     INFO     = GREEN
#     DEBUG    = CYAN
#     FOREGROUND_BLACK     = 0x0000
#     FOREGROUND_BLUE      = 0x0001
#     FOREGROUND_GREEN     = 0x0002
#     FOREGROUND_CYAN      = 0x0003
#     FOREGROUND_RED       = 0x0004
#     FOREGROUND_MAGENTA   = 0x0005
#     FOREGROUND_YELLOW    = 0x0006
#     FOREGROUND_GREY      = 0x0007
#     FOREGROUND_INTENSITY = 0x0008 # foreground color is intensified.
#     FOREGROUND_WHITE     = FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED
#     BACKGROUND_BLACK     = 0x0000
#     BACKGROUND_BLUE      = 0x0010
#     BACKGROUND_GREEN     = 0x0020
#     BACKGROUND_CYAN      = 0x0030
#     BACKGROUND_RED       = 0x0040
#     BACKGROUND_MAGENTA   = 0x0050
#     BACKGROUND_YELLOW    = 0x0060
#     BACKGROUND_GREY      = 0x0070
#     BACKGROUND_INTENSITY = 0x0080 # background color is intensified.
#     DEFAULT  = FOREGROUND_WHITE
#     CRITICAL = BACKGROUND_YELLOW | FOREGROUND_RED | FOREGROUND_INTENSITY | BACKGROUND_INTENSITY
#     ERROR    = FOREGROUND_RED | FOREGROUND_INTENSITY
#     WARNING  = FOREGROUND_YELLOW | FOREGROUND_INTENSITY
#     INFO     = FOREGROUND_GREEN
#     DEBUG    = FOREGROUND_CYAN
#     def _get_color(cls, level):
#     def __init__(self, stream=None):
#     def format(self, record):
#     def _get_color(cls, level):
#     def _set_color(self, code):
#     def __init__(self, stream=None):
#     def emit(self, record):


import rel_imp; rel_imp.init()
import logging
from .ColorStreamHandler import ColorStreamHandler
            logging.debug('Ignoring broken pipe')
            raise SystemExit
        # Forward error
        raise


class Logger(object):
    default_level = logging.INFO
    handler_level = logging.DEBUG
    default_fmt = '%(levelname)s %(asctime)s: %(message)s'
    default_datefmt = '%H:%M:%S'

    def __init__(self, name=None, output=None, level=None, color=False):
        if not level:
            level = self.default_level
        if not output:
            if not name:
                output = logging.getLogger()
            else:
                output = logging.getLogger(name)
        self.output = output
        self.color = color
        if not logging.root.handlers:
            self._config_handler()
            self.set_fmt()
            self.setLevel(level)

    def _config_handler(self):
        if not self.output.handlers:
            if self.color:

# Path: xpathwebdriver/ColorStreamHandler.py
# class _AnsiColorStreamHandler(logging.StreamHandler):
# class _WinColorStreamHandler(logging.StreamHandler):
#     DEFAULT = '\x1b[0m'
#     RED     = '\x1b[31m'
#     GREEN   = '\x1b[32m'
#     YELLOW  = '\x1b[33m'
#     CYAN    = '\x1b[36m'
#     CRITICAL = RED
#     ERROR    = RED
#     WARNING  = YELLOW
#     INFO     = GREEN
#     DEBUG    = CYAN
#     FOREGROUND_BLACK     = 0x0000
#     FOREGROUND_BLUE      = 0x0001
#     FOREGROUND_GREEN     = 0x0002
#     FOREGROUND_CYAN      = 0x0003
#     FOREGROUND_RED       = 0x0004
#     FOREGROUND_MAGENTA   = 0x0005
#     FOREGROUND_YELLOW    = 0x0006
#     FOREGROUND_GREY      = 0x0007
#     FOREGROUND_INTENSITY = 0x0008 # foreground color is intensified.
#     FOREGROUND_WHITE     = FOREGROUND_BLUE | FOREGROUND_GREEN | FOREGROUND_RED
#     BACKGROUND_BLACK     = 0x0000
#     BACKGROUND_BLUE      = 0x0010
#     BACKGROUND_GREEN     = 0x0020
#     BACKGROUND_CYAN      = 0x0030
#     BACKGROUND_RED       = 0x0040
#     BACKGROUND_MAGENTA   = 0x0050
#     BACKGROUND_YELLOW    = 0x0060
#     BACKGROUND_GREY      = 0x0070
#     BACKGROUND_INTENSITY = 0x0080 # background color is intensified.
#     DEFAULT  = FOREGROUND_WHITE
#     CRITICAL = BACKGROUND_YELLOW | FOREGROUND_RED | FOREGROUND_INTENSITY | BACKGROUND_INTENSITY
#     ERROR    = FOREGROUND_RED | FOREGROUND_INTENSITY
#     WARNING  = FOREGROUND_YELLOW | FOREGROUND_INTENSITY
#     INFO     = FOREGROUND_GREEN
#     DEBUG    = FOREGROUND_CYAN
#     def _get_color(cls, level):
#     def __init__(self, stream=None):
#     def format(self, record):
#     def _get_color(cls, level):
#     def _set_color(self, code):
#     def __init__(self, stream=None):
#     def emit(self, record):


# Path: xpathwebdriver/logger.py
import rel_imp; rel_imp.init()
import logging
from .ColorStreamHandler import ColorStreamHandler

            logging.debug('Ignoring broken pipe')
            raise SystemExit
        # Forward error
        raise


class Logger(object):
    default_level = logging.INFO
    handler_level = logging.DEBUG
    default_fmt = '%(levelname)s %(asctime)s: %(message)s'
    default_datefmt = '%H:%M:%S'

    def __init__(self, name=None, output=None, level=None, color=False):
        if not level:
            level = self.default_level
        if not output:
            if not name:
                output = logging.getLogger()
            else:
                output = logging.getLogger(name)
        self.output = output
        self.color = color
        if not logging.root.handlers:
            self._config_handler()
            self.set_fmt()
            self.setLevel(level)

    def _config_handler(self):
        if not self.output.handlers:
            if self.color:

                hdlr = ColorStreamHandler()