Esempio n. 1
0
    def __init__(self, main, filename, loadsavers):

        self.filename = get_user_path(filename)

        self.main = main
        self.peers = {}   # {ipp -> time}
        self.exempt_ips = set()

        self.loadsavers = set(loadsavers)
Esempio n. 2
0
    def __init__(self, main, filename, loadsavers):

        self.filename = get_user_path(filename)

        self.main = main
        self.peers = {}  # {ipp -> time}
        self.exempt_ips = set()

        self.loadsavers = set(loadsavers)
Esempio n. 3
0
def setLogFile(filename, max_size, max_archives):
    global log_file_defined
    try:
        log_file_defined
        raise AssertionError("setLogFile already called")
    except NameError:
        log_file_defined = True

    # Create file handler and set level to debug (rotates logs)
    fh = logging.handlers.RotatingFileHandler(
        get_user_path(filename), 'a', max_size, max_archives)
    fh.setLevel(5)
    fh.setFormatter(logging.Formatter(
        "%(asctime)s - %(levelname).1s - %(message)s"))
    LOG.addHandler(fh)
Esempio n. 4
0
def setLogFile(filename, max_size, max_archives):
    global log_file_defined
    try:
        log_file_defined
        raise AssertionError("setLogFile already called")
    except NameError:
        log_file_defined = True

    # Create file handler and set level to debug (rotates logs)
    fh = logging.handlers.RotatingFileHandler(
        get_user_path(filename), 'a', max_size, max_archives)
    fh.setLevel(5)
    fh.setFormatter(logging.Formatter(
        "%(asctime)s - %(levelname).1s - %(message)s"))
    LOG.addHandler(fh)