human
Complete the below
def log_function(f):

    ''''Function decorator that logs every call to that function.'
    '''

=====
What is a the Python code you requested?
assistant
#Here is the Python code you requested.
    func_name = f.__name__
    @wraps(f)
    def wrapped(*args, **kwargs):
        name = f.__module__
        logger = logging.getLogger(name)
        level = logging.DEBUG
        if logger.isEnabledFor(level):
            bound_args = getcallargs(f, *args, **kwargs)
            def format(value):
                r = str(value)
                if (len(r) > 50):
                    r = (r[:50] + '...')
                return r
            func_args = [('%s=%s' % (k, format(v))) for (k, v) in bound_args.items()]
            msg_args = {'func_name': func_name, 'args': ',    '.join(func_args)}
            _log_debug_as_f(f, "Invoked    '%(func_name)s'    with    args:    %(args)s", msg_args)
        return f(*args, **kwargs)
    wrapped.__name__ = func_name
    return wrapped