# Path: theonionbox/tob/deviation.py
# def getTimer(ntp_server=None):
# 
#     global __timer__
# 
#     if ntp_server is not None:
#         __timer__ = Timer(ntp_server)
# 
#     return __timer__


from typing import Dict
from collections import deque
from logging.handlers import MemoryHandler
from logging import Filter, _checkLevel
from time import time, strftime, mktime, localtime
from stem import ProtocolError
from .deviation import getTimer
            from .terminalsize import get_terminal_size
import functools
import logging
import os.path
import sys
import uuid
                elif level == 'ERROR':
                    tor_level = 'ERR'
                else:
                    tor_level = level

                lgr.debug(
                    "Adding event_listener for Tor's runlevel '{}': {}".format(tor_level,
                                                                               self.event_handlers[level]))
                try:
                    self.tor.add_event_listener(self.event_handlers[level], tor_level)
                except ProtocolError as pe:
                    lgr.debug("Failed to add event_listener for runlevel '{}': {}".format(level, pe))

            if status is False:
                lgr.debug(
                    "Removing event_listener for runlevel '{}': {}".format(level, self.event_handlers[level]))
                try:
                    self.tor.remove_event_listener(self.event_handlers[level])
                except ProtocolError as pe:
                    lgr.debug("Failed to remove event_listener for runlevel '{}': {}".format(level, pe))

    def notice(self, message):
        self._log(message, 'NOTICE')

    # We could add here trace, debug and others later ... if necessary

    def _log(self, message, level):

        # The Unpacker of the log messages expects a certain format
        # ... thus we have to provide this here for standard messages.

# Path: theonionbox/tob/deviation.py
# def getTimer(ntp_server=None):
# 
#     global __timer__
# 
#     if ntp_server is not None:
#         __timer__ = Timer(ntp_server)
# 
#     return __timer__


# Path: theonionbox/tob/log.py
from typing import Dict
from collections import deque
from logging.handlers import MemoryHandler
from logging import Filter, _checkLevel
from time import time, strftime, mktime, localtime
from stem import ProtocolError
from .deviation import getTimer
            from .terminalsize import get_terminal_size
import functools
import logging
import os.path
import sys
import uuid

                elif level == 'ERROR':
                    tor_level = 'ERR'
                else:
                    tor_level = level

                lgr.debug(
                    "Adding event_listener for Tor's runlevel '{}': {}".format(tor_level,
                                                                               self.event_handlers[level]))
                try:
                    self.tor.add_event_listener(self.event_handlers[level], tor_level)
                except ProtocolError as pe:
                    lgr.debug("Failed to add event_listener for runlevel '{}': {}".format(level, pe))

            if status is False:
                lgr.debug(
                    "Removing event_listener for runlevel '{}': {}".format(level, self.event_handlers[level]))
                try:
                    self.tor.remove_event_listener(self.event_handlers[level])
                except ProtocolError as pe:
                    lgr.debug("Failed to remove event_listener for runlevel '{}': {}".format(level, pe))

    def notice(self, message):
        self._log(message, 'NOTICE')

    # We could add here trace, debug and others later ... if necessary

    def _log(self, message, level):

        # The Unpacker of the log messages expects a certain format
        # ... thus we have to provide this here for standard messages.

        timer = getTimer()