human
I wrote the below code

    @functools.wraps(f)
    def wrapper(*args, **kwargs):
        session = settings.Session()
        if (current_user and hasattr(current_user, 'username')):
            user = current_user.username
        else:
            user = 'anonymous'
        log = models.Log(event=f.__name__, task_instance=None, owner=user, extra=str(list(request.args.items())), task_id=request.args.get('task_id'), dag_id=request.args.get('dag_id'))
        if ('execution_date' in request.args):
            log.execution_date = dateparser.parse(request.args.get('execution_date'))
        session.add(log)
        session.commit()
        return f(*args, **kwargs)
    return wrapper

What's a good function header?
 ... Here's a good function header?
assistant
#Here's a good function header.

def action_logging(f):