"""
Manages logging throughout the Rookeries API.

:copyright: Copyright 2013-2016, Dorian Pula <dorian.pula@amber-penguin-software.ca>
:license: AGPL v3+
"""

import logging.config


LOG_CONFIG = {
    'version': 1,
    'formatters': {
        'simple': {
            'format': '%(asctime)s - [%(levelname)s] - %(name)s - %(message)s'
        },
    },

    'handlers': {
        'console': {
            'class': 'logging.StreamHandler',
            'level': 'DEBUG',
            'formatter': 'simple',
            'stream': 'ext://sys.stdout',
        }
    },

    'loggers': {
        'simpleExample': {
            'level': 'DEBUG',
            'handlers': ['console'],
            'propagate': False,
        },
    },

    'root': {
        'level': 'INFO',
        'handlers': ['console'],
        'propagate': False
    },

    'disable_existing_loggers': False,
}


def configure_logging():
    logging.config.dictConfig(LOG_CONFIG)
