def autolog(message, from_func=None):
    """Automatically log the current function details."""
    import inspect, logging
    if not from_func:
        from_func = inspect.currentframe().f_back.f_code
    logging.debug('-' * 40)
    logging.debug('  %s  %s in %s:%i' % (message, from_func.co_name,
        from_func.co_filename.split('/')[-1], from_func.co_firstlineno))
