# 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__
        make_sync_or_changes_dict(state_changes),
        settings,
    )


def create_event(settings, plugin, type, description, data=None):
    return make_api_request(
        get_session().post,
        'server/{0}/event'.format(settings.server_id),
        settings=settings,
        json={
            'plugin': plugin,
            'type': type,
            'description': description,
            'data': data,
        },
    )


def register(key):
    '''
    Register this server on api.servicecanary.com and return a server id.
    '''

    response_data = make_api_request(
        get_session().post,
        'servers',
        api_key=key,
        json={
            'hostname': socket.gethostname(),

# 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__

        make_sync_or_changes_dict(state_changes),
        settings,
    )


def create_event(settings, plugin, type, description, data=None):
    return make_api_request(
        get_session().post,
        'server/{0}/event'.format(settings.server_id),
        settings=settings,
        json={
            'plugin': plugin,
            'type': type,
            'description': description,
            'data': data,
        },
    )


def register(key):
    '''
    Register this server on api.servicecanary.com and return a server id.
    '''

    response_data = make_api_request(
        get_session().post,
        'servers',
        api_key=key,
        json={
            'hostname': socket.gethostname(),

            'canaryd_version': __version__,