def add_msg(self, level, msg, multiline=False):
        """
        Add message into result
        Empty messages are skipped

        multiline - don't split message lines into
            multiple messages
        """
        # Create messages structure if it doesn't exists
        if not self.result['messages']:
            self.result['messages'] = {
                'info' : [],
                'error': [],
                'warn' : [],
            }

        if not multiline:
            messages = str(msg).split('\n')
        else:
            messages = [str(msg)]

        for message in messages:
            # Skip adding empty message
            if not str(msg).strip():
                continue

            try:
                self.result['messages'][level].append(str(message).strip())
            except __HOLE__:
                raise InvalidArgument("Level has to be info, error or warn")
dataset/ETHPy150Open gooddata/smoker/smoker/server/plugins/__init__.py/Result.add_msg