import logging


def logger(name, level=None):
    """
    Create logger with appropriate level.
    """
    ret = logging.getLogger(name)
    ret.addHandler(logging.StreamHandler())
    ret.setLevel(getattr(logging, level) if level else logging.INFO)
    return ret