import inspect
import logging


def logger(**kwargs):
    """A logger named after the module it's called in."""
    caller = inspect.stack()[1]
    name = caller.frame.f_globals.get('__name__', 'UNKNOWN')
    return logging.getLogger(name, **kwargs)