def display(self, msg, color=None, stderr=False, screen_only=False, log_only=False, newline=True):
    ' Display a message to the user\n\n        Note: msg *must* be a unicode string to prevent UnicodeError tracebacks.\n        '
    nocolor = msg
    if (not log_only):
        has_newline = msg.endswith(u'\n')
        if has_newline:
            msg2 = msg[:(- 1)]
        else:
            msg2 = msg
        if color:
            msg2 = stringc(msg2, color)
        if (has_newline or newline):
            msg2 = (msg2 + u'\n')
        msg2 = to_bytes(msg2, encoding=self._output_encoding(stderr=stderr))
        if (sys.version_info >= (3,)):
            msg2 = to_text(msg2, self._output_encoding(stderr=stderr), errors='replace')
        if (not stderr):
            fileobj = sys.stdout
        else:
            fileobj = sys.stderr
        fileobj.write(msg2)
        try:
            fileobj.flush()
        except IOError as e:
            if (e.errno != errno.EPIPE):
                raise
    if (logger and (not screen_only)):
        msg2 = to_bytes(nocolor.lstrip(u'\n'))
        if (sys.version_info >= (3,)):
            msg2 = to_text(msg2, self._output_encoding(stderr=stderr))
        lvl = logging.INFO
        if color:
            try:
                lvl = color_to_log_level[color]
            except KeyError:
                raise AnsibleAssertionError(('Invalid color supplied to display: %s' % color))
        logger.log(lvl, msg2)
Display a message to the user

Note: msg *must* be a unicode string to prevent UnicodeError tracebacks.
def display(self, msg, color=None, stderr=False, screen_only=False, log_only=False, newline=True):
    ' Display a message to the user\n\n        Note: msg *must* be a unicode string to prevent UnicodeError tracebacks.\n        '
    nocolor = msg
    if (not log_only):
        has_newline = msg.endswith(u'\n')
        if has_newline:
            msg2 = msg[:(- 1)]
        else:
            msg2 = msg
        if color:
            msg2 = stringc(msg2, color)
        if (has_newline or newline):
            msg2 = (msg2 + u'\n')
        msg2 = to_bytes(msg2, encoding=self._output_encoding(stderr=stderr))
        if (sys.version_info >= (3,)):
            msg2 = to_text(msg2, self._output_encoding(stderr=stderr), errors='replace')
        if (not stderr):
            fileobj = sys.stdout
        else:
            fileobj = sys.stderr
        fileobj.write(msg2)
        try:
            fileobj.flush()
        except IOError as e:
            if (e.errno != errno.EPIPE):
                raise
    if (logger and (not screen_only)):
        msg2 = to_bytes(nocolor.lstrip(u'\n'))
        if (sys.version_info >= (3,)):
            msg2 = to_text(msg2, self._output_encoding(stderr=stderr))
        lvl = logging.INFO
        if color:
            try:
                lvl = color_to_log_level[color]
            except KeyError:
                raise AnsibleAssertionError(('Invalid color supplied to display: %s' % color))
        logger.log(lvl, msg2)