import ast


def _log_function(item):
    """
    Handler function for log message types.

    :param item: ast object being inspected for certain properties
    :type item: :class:`~ast.AST`
    :return: Returns the descriptor and arg offset of the item.
    :rtype: tuple (str, int)
    """
    level_arg = item.args[0]
    if isinstance(level_arg, ast.Str):
        level = level_arg.s.lower()
    else:
        any_call_or_name_elements = any(
            isinstance(element, (ast.Call, ast.Name))
            for element in ast.walk(level_arg)
        )
        if any_call_or_name_elements:
            level = "(dynamic)"
        else:
            level = ', '.join(
                element.s.lower()
                for element in ast.walk(level_arg)
                if isinstance(element, ast.Str)
            )
    integer_arg_offset = 1
    return level, integer_arg_offset