# Path: torext/utils.py
# def split_kwargs(kwgs_tuple, kwgs):
#     _kwgs = {}
#     for i in kwgs_tuple:
#         if i in kwgs:
#             _kwgs[i] = kwgs.pop(i)
#     return _kwgs
# 
# Path: torext/compat.py
# def unicode_(s, *args):
#     return unicode(s, *args)
# 
# def decode_(s, *args):
#     return s.decode(*args)


import sys
import logging
        import curses
from torext.utils import split_kwargs
from torext.compat import unicode_ as u_, decode_
    from nose.plugins.logcapture import MyMemoryHandler
#!/usr/bin/env python
# -*- coding: utf-8 -*-



try:
except ImportError:
    MyMemoryHandler = None


root_logger = logging.getLogger()

app_log = logging.getLogger('torext.app')
request_log = logging.getLogger('torext.request')


# borrow from tornado.options._LogFormatter.__init__
def _color(lvl):
    try:
    except ImportError:
        curses = None
    color = False
    if curses and sys.stderr.isatty():
        try:
            curses.setupterm()
            if curses.tigetnum("colors") > 0:
                color = True
        except:
            pass
    if not color:

# Path: torext/utils.py
# def split_kwargs(kwgs_tuple, kwgs):
#     _kwgs = {}
#     for i in kwgs_tuple:
#         if i in kwgs:
#             _kwgs[i] = kwgs.pop(i)
#     return _kwgs
# 
# Path: torext/compat.py
# def unicode_(s, *args):
#     return unicode(s, *args)
# 
# def decode_(s, *args):
#     return s.decode(*args)


# Path: torext/log.py
import sys
import logging
        import curses
from torext.utils import split_kwargs
from torext.compat import unicode_ as u_, decode_
    from nose.plugins.logcapture import MyMemoryHandler

#!/usr/bin/env python
# -*- coding: utf-8 -*-



try:
except ImportError:
    MyMemoryHandler = None


root_logger = logging.getLogger()

app_log = logging.getLogger('torext.app')
request_log = logging.getLogger('torext.request')


# borrow from tornado.options._LogFormatter.__init__
def _color(lvl):
    try:
    except ImportError:
        curses = None
    color = False
    if curses and sys.stderr.isatty():
        try:
            curses.setupterm()
            if curses.tigetnum("colors") > 0:
                color = True
        except:
            pass
    if not color:

        return u_(''), u_('')