# 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
# def get_settings(config_file=None):
#     '''
#     Cached/public version of _get_settings.
#     '''
# 
#     global SETTINGS
# 
#     if SETTINGS is None:
#         SETTINGS = _get_settings(config_file=config_file)
# 
#     return SETTINGS
# 
# VALID_STATUSES = ('DIFF', 'SYNC', 'ERROR', 'EVENTS')
# 
# Path: canaryd/version.py



import socket
from json import dumps as json_dumps, JSONEncoder
from time import sleep
from canaryd_packages import requests, six
from canaryd.log import logger
from canaryd.settings import get_settings, VALID_STATUSES
from canaryd.version import __version__
            if interval + 10 <= max_wait:
                interval += 10

            e.log()

        logger.critical('{0}, retrying in {1}s'.format(error_message, interval))
        sleep(interval)


class ApiError(Exception):
    '''
    Generic exception for problems with the API.
    '''

    def __init__(self, status_code, name, message=None, content=None):
        self.status_code = status_code
        self.name = name
        self.message = message
        self.content = content

    def log(self):
        logger.critical(
            '{0}: {1}{2}'.format(
                self.status_code,
                self.name,
                '({0})'.format(self.message) if self.message else '',
            ),
        )

        if self.content:

# 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
# def get_settings(config_file=None):
#     '''
#     Cached/public version of _get_settings.
#     '''
# 
#     global SETTINGS
# 
#     if SETTINGS is None:
#         SETTINGS = _get_settings(config_file=config_file)
# 
#     return SETTINGS
# 
# VALID_STATUSES = ('DIFF', 'SYNC', 'ERROR', 'EVENTS')
# 
# Path: canaryd/version.py



# Path: canaryd/remote.py
import socket
from json import dumps as json_dumps, JSONEncoder
from time import sleep
from canaryd_packages import requests, six
from canaryd.log import logger
from canaryd.settings import get_settings, VALID_STATUSES
from canaryd.version import __version__

            if interval + 10 <= max_wait:
                interval += 10

            e.log()

        logger.critical('{0}, retrying in {1}s'.format(error_message, interval))
        sleep(interval)


class ApiError(Exception):
    '''
    Generic exception for problems with the API.
    '''

    def __init__(self, status_code, name, message=None, content=None):
        self.status_code = status_code
        self.name = name
        self.message = message
        self.content = content

    def log(self):
        logger.critical(
            '{0}: {1}{2}'.format(
                self.status_code,
                self.name,
                '({0})'.format(self.message) if self.message else '',
            ),
        )

        if self.content:

            logger.debug('Response data: {0}'.format(self.content))