# Path: simiki/utils.py
# def color_msg(color, msg):
#     return COLOR_CODES[color] + msg + COLOR_CODES["reset"]
# 
# Path: simiki/log.py
# def logging_init(level=None, logger=getLogger(),
#                  handler=StreamHandler(), use_color=True):
#     if use_color and _is_platform_allowed_ansi():
#         fmt = ANSIFormatter()
#     else:
#         fmt = NonANSIFormatter()
#     handler.setFormatter(fmt)
#     logger.addHandler(handler)
# 
#     if level:
#         logger.setLevel(level)
# 
# Path: simiki/compat.py



import unittest
import logging
import nose
    from cStringIO import StringIO
        from StringIO import StringIO
        from io import StringIO as StringIO
from simiki.utils import color_msg
from simiki.log import logging_init
from simiki.compat import is_py2, unicode
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function, with_statement, unicode_literals

try:
    # py2
except ImportError:
    try:
        # py2
    except ImportError:
        # py3
        # from io import BytesIO as StringIO




class TestLogInit(unittest.TestCase):

    def setUp(self):
        logging.disable(logging.NOTSET)
        self.stream = StringIO()
        self.logger = logging.getLogger()
        self.handler = logging.StreamHandler(self.stream)
        for handler in self.logger.handlers:
            # exclude nosetest capture handler

# Path: simiki/utils.py
# def color_msg(color, msg):
#     return COLOR_CODES[color] + msg + COLOR_CODES["reset"]
# 
# Path: simiki/log.py
# def logging_init(level=None, logger=getLogger(),
#                  handler=StreamHandler(), use_color=True):
#     if use_color and _is_platform_allowed_ansi():
#         fmt = ANSIFormatter()
#     else:
#         fmt = NonANSIFormatter()
#     handler.setFormatter(fmt)
#     logger.addHandler(handler)
# 
#     if level:
#         logger.setLevel(level)
# 
# Path: simiki/compat.py



# Path: tests/test_log.py
import unittest
import logging
import nose
    from cStringIO import StringIO
        from StringIO import StringIO
        from io import StringIO as StringIO
from simiki.utils import color_msg
from simiki.log import logging_init
from simiki.compat import is_py2, unicode

#!/usr/bin/env python
# -*- coding: utf-8 -*-
from __future__ import print_function, with_statement, unicode_literals

try:
    # py2
except ImportError:
    try:
        # py2
    except ImportError:
        # py3
        # from io import BytesIO as StringIO




class TestLogInit(unittest.TestCase):

    def setUp(self):
        logging.disable(logging.NOTSET)
        self.stream = StringIO()
        self.logger = logging.getLogger()
        self.handler = logging.StreamHandler(self.stream)
        for handler in self.logger.handlers:
            # exclude nosetest capture handler

            if not isinstance(handler,