# Path: canaryd/exceptions.py
# class ConfigError(CanarydError):
#     '''
#     Triggered when the config file is invalid/broken/missing.
#     '''
# 
# Path: canaryd/log.py
# STDOUT_LOG_LEVELS = (logging.DEBUG, logging.INFO)
# STDERR_LOG_LEVELS = (logging.WARNING, logging.ERROR, logging.CRITICAL)
# class LogFilter(logging.Filter):
# class LogFormatter(logging.Formatter):
#     def __init__(self, *levels):
#     def filter(self, record):
#     def format(self, record):
# def setup_logging(verbose, debug, default_level=logging.CRITICAL):
# def setup_logging_from_settings(settings):
# def print_exception(debug_only=False):


import platform
from collections import defaultdict
from os import environ, geteuid, makedirs, path
from canaryd_packages import click, six
from canaryd_packages.six.moves.configparser import (
    DuplicateSectionError,
    Error as ConfigParserError,
    RawConfigParser,
)
from canaryd.exceptions import ConfigError
from canaryd.log import logger
    log_file_rotation = None
    # Number of files to rotate
    log_file_rotation_count = 5

    # syslog facility to log to
    syslog_facility = None

    debug = False

    collect_interval_s = 30
    # Only collect slow plugin data this often
    slow_collect_interval_s = 900

    # API access key
    api_key = API_KEY

    # ID of (hopefully this) server attached to this key
    server_id = SERVER_ID

    def __init__(self, **kwargs):
        self.update(kwargs)

        self.plugin_settings = defaultdict(dict)

        # If no log file specified, we're root and /var/log exists, use that
        if (
            self.log_file is None
            and geteuid() <= 0
            and path.exists(path.join('/', 'var', 'log'))
        ):

# Path: canaryd/exceptions.py
# class ConfigError(CanarydError):
#     '''
#     Triggered when the config file is invalid/broken/missing.
#     '''
# 
# Path: canaryd/log.py
# STDOUT_LOG_LEVELS = (logging.DEBUG, logging.INFO)
# STDERR_LOG_LEVELS = (logging.WARNING, logging.ERROR, logging.CRITICAL)
# class LogFilter(logging.Filter):
# class LogFormatter(logging.Formatter):
#     def __init__(self, *levels):
#     def filter(self, record):
#     def format(self, record):
# def setup_logging(verbose, debug, default_level=logging.CRITICAL):
# def setup_logging_from_settings(settings):
# def print_exception(debug_only=False):


# Path: canaryd/settings.py
import platform
from collections import defaultdict
from os import environ, geteuid, makedirs, path
from canaryd_packages import click, six
from canaryd_packages.six.moves.configparser import (
    DuplicateSectionError,
    Error as ConfigParserError,
    RawConfigParser,
)
from canaryd.exceptions import ConfigError
from canaryd.log import logger

    log_file_rotation = None
    # Number of files to rotate
    log_file_rotation_count = 5

    # syslog facility to log to
    syslog_facility = None

    debug = False

    collect_interval_s = 30
    # Only collect slow plugin data this often
    slow_collect_interval_s = 900

    # API access key
    api_key = API_KEY

    # ID of (hopefully this) server attached to this key
    server_id = SERVER_ID

    def __init__(self, **kwargs):
        self.update(kwargs)

        self.plugin_settings = defaultdict(dict)

        # If no log file specified, we're root and /var/log exists, use that
        if (
            self.log_file is None
            and geteuid() <= 0
            and path.exists(path.join('/', 'var', 'log'))
        ):

            logger.debug('Root user, so setting log file to /var/log/canaryd.log')