# Path: common/log.py
# class RainbowLogFormatter(logging.Formatter):
# class ContextFilter(logging.Filter):  # pylint: disable=too-few-public-methods
# class PapertrailHandler(logging.handlers.SysLogHandler):
#     def format(self, record):
#     def filter(self, record):
#     def __init__(self, *args, **kwargs):
# def init_logging(level=logging.INFO):


import os
import sys
import models  # pylint: disable=unused-import,wrong-import-position
from common import log
#! /usr/bin/env python -i
""" Load some useful stuff into the console when running python interactively. """


def _set_prompt():
    """ Color code the Python prompt based on environment. """
    env = os.environ.get('ENV', 'dev')
    color = {'dev': '32',  # Green
             'stage': '33',  # Yellow
             'prod': '31'}.get(env)  # Red
    sys.ps1 = '\001\033[1;%sm\002>>> \001\033[0m\002' % color
    sys.ps2 = '\001\033[1;%sm\002... \001\033[0m\002' % color


# Path: common/log.py
# class RainbowLogFormatter(logging.Formatter):
# class ContextFilter(logging.Filter):  # pylint: disable=too-few-public-methods
# class PapertrailHandler(logging.handlers.SysLogHandler):
#     def format(self, record):
#     def filter(self, record):
#     def __init__(self, *args, **kwargs):
# def init_logging(level=logging.INFO):


# Path: console.py
import os
import sys
import models  # pylint: disable=unused-import,wrong-import-position
from common import log

#! /usr/bin/env python -i
""" Load some useful stuff into the console when running python interactively. """


def _set_prompt():
    """ Color code the Python prompt based on environment. """
    env = os.environ.get('ENV', 'dev')
    color = {'dev': '32',  # Green
             'stage': '33',  # Yellow
             'prod': '31'}.get(env)  # Red
    sys.ps1 = '\001\033[1;%sm\002>>> \001\033[0m\002' % color
    sys.ps2 = '\001\033[1;%sm\002... \001\033[0m\002' % color


log.init_logging(log.logging.DEBUG)