# Path: nuka/utils.py
# LOG = 60
# 
# Path: nuka/utils.py
# CHANGED = logging.WARNING + 1


import logging
import sys
import os
import nuka
from nuka.utils import LOG
from nuka.utils import CHANGED

    def debug3(self, *args, **kwargs):
        self._extra_logs(logging.DEBUG, 3, *args, **kwargs)

    def debug4(self, *args, **kwargs):
        self._extra_logs(logging.DEBUG, 4, *args, **kwargs)

    def debug5(self, *args, **kwargs):
        self._extra_logs(logging.DEBUG, 5, *args, **kwargs)

    def exception5(self, *args, **kwargs):
        if nuka.cli.args.verbose > 5:
            self.exception(*args, **kwargs)


class HostFileHandler(logging.FileHandler):

    __rollover = False

    def __init__(self, host, level, filename=None):
        self.host = host
        logdir = nuka.config['log']['dirname']
        if filename:
            self.filename = filename
            if not self.__rollover:
                # if filename is specified, rollover only once during run time
                self.__class__.__rollover = True
                self.rollover()
        else:
            self.filename = os.path.join(logdir, '{0}.log'.format(host))

# Path: nuka/utils.py
# LOG = 60
# 
# Path: nuka/utils.py
# CHANGED = logging.WARNING + 1


# Path: nuka/log.py
import logging
import sys
import os
import nuka
from nuka.utils import LOG
from nuka.utils import CHANGED


    def debug3(self, *args, **kwargs):
        self._extra_logs(logging.DEBUG, 3, *args, **kwargs)

    def debug4(self, *args, **kwargs):
        self._extra_logs(logging.DEBUG, 4, *args, **kwargs)

    def debug5(self, *args, **kwargs):
        self._extra_logs(logging.DEBUG, 5, *args, **kwargs)

    def exception5(self, *args, **kwargs):
        if nuka.cli.args.verbose > 5:
            self.exception(*args, **kwargs)


class HostFileHandler(logging.FileHandler):

    __rollover = False

    def __init__(self, host, level, filename=None):
        self.host = host
        logdir = nuka.config['log']['dirname']
        if filename:
            self.filename = filename
            if not self.__rollover:
                # if filename is specified, rollover only once during run time
                self.__class__.__rollover = True
                self.rollover()
        else:
            self.filename = os.path.join(logdir, '{0}.log'.format(host))

            self.rollover()