Treat the message (formatting), and dispatch them.

@param {Array} messages array of message
@param {string} type the type of message
977567
function _treatGlobalMessagesPerType(messages, type) {
    messages.forEach(function convertErrorsIntoNotification(element) {
        let options = {};
        if (isObject(element)) {
            options = _formatParameters(element.parameters);
            element = element.message;
        }
        addMessage({
            type: type,
            content: translate(element, options),
            creationDate: Date.now()
        });
    });
}
696620
public function setMessage($message, $type = 'info', $key = 'messages')
    {
        if ($message !== '') {

            $messages = (array) $this->get("$key.$type", array());

            if (!in_array($message, $messages)) {
                $messages[] = $message;
                $this->set("$key.$type", $messages);
            }
        }
    }
1309244
public function addMessage($message, $type) {
		if (isset($_SESSION[$this->sessionKey]))
		{
			$messages = $_SESSION[$this->sessionKey];
		}
		
		$messages[] = [
			'message' => $message,
			'type' => $type,
		];
		
		$_SESSION[$this->sessionKey] = $messages;
	}
1183593
function(type) {
            var args = Array.prototype.slice.call(arguments, 1);
            var level = configs.logLevels[this.namespace] || configs.logLevel;

            if (this.logLevel(type) < this.logLevel(level)) {
                return this;
            }
            args.splice(0, 0, "[" + this.namespace + "] [" + type + "]");
            var logMethod = Function.prototype.bind.call(this.handler[type], this.handler);
            logMethod.apply(this.handler[type], args);
        }
17326
function format( type, args ) {
  var now = new Date().toISOString(),
    tmpl = '[%s] %s: %s\n',
    msg;

  msg = args[ 0 ] instanceof Error ? args[ 0 ].stack :
    util.format.apply( util, args );

  return util.format( tmpl, now, type, msg );
}
145249
function (message, important) {
            /** @type {string} */
            const prefix = 'VarGate SG1 Log:';
            /** @type {Array} */
            let args = [];
            if (window['DEBUG_MODE']) {
                if (typeof message !== 'string' && message.length) {
                    args = message;
                } else {
                    args.push(message);
                }
                args.unshift(prefix);
                try {
                    switch (window['DEBUG_MODE']) {
                        case 'verbose':
                            console['warn'].apply(console, args);
                            break;
                        case 'static':
                            console['warn'].apply(console, JSON.parse(JSON.stringify(args)));
                            break;
                        case 'minimal':
                            if (important) console['warn'].apply(console, args);
                            break;
                        default:
                        // do nothing
                    }
                } catch (e) {
                    // Looks like we can't log anything
                }
            }
        }
1091513
function MessageEvent (type, eventInitDict) {
  Object.defineProperty(this, 'type', { writable: false, value: type, enumerable: true })
  for (var f in eventInitDict) {
    if (eventInitDict.hasOwnProperty(f)) {
      Object.defineProperty(this, f, { writable: false, value: eventInitDict[f], enumerable: true })
    }
  }
}
437010
function log(type, args, color){
  pad();
  var msg = format.apply(format, args);
  if (color) msg = chalk[color](msg);
  var pre = prefix();
  console[type](pre, msg);
}
677334
private function populateMessages(array $messages, $type, $group)
    {
        foreach ($messages as $message) {
            $this->messages[] = ['message' => $message, 'type' => $type, 'group' => $group];
        }
    }
222709
function messageFormat (type, inspect) {
  var msg = this.detailed
    ? 'expect %s `%s`, but %s `%s` given'
    : 'expect `%s`, but `%s` given'
  return this.detailed
    ? util.format(msg, type.expected, inspect.expected, type.actual, inspect.actual)
    : util.format(msg, type.expected, type.actual)
}
1005854
function(msg){
    var type = this.peek().type
      , val = undefined == this.peek().val
        ? ''
        : ' ' + this.peek().toString();
    if (val.trim() == type.trim()) val = '';
    throw new errors.ParseError(msg.replace('{peek}', '"' + type + val + '"'));
  }
839812
function log(type, msg, code) {
  code = code || 0;
  if ((exports.level & code) > 0) {
    var listener = exports.on[type];
    if (listener) {
      listener(msg);
    }
    exports.on.any(type, msg);
  }
}
320273
public static function addMessage($message, $type = 'default')
    {
        if (is_array($message)) {
            foreach ($message as $msg) {
                static::addMessage($msg);
            }

            return;
        }

        try {
            $collector = static::getInstance();
        } catch (\UnexpectedValueException $e) {
            return;
        }

        $data = $collector['debug.messages'];

        if ($data === null) {
            $data = [];
        }

        $data[] = [
            'message' => $message,
            'type' => $type,
            'timestamp' => microtime(true),
        ];

        $collector['debug.messages'] = $data;
    }
558669
public function message($message, $type = 'line')
    {
        if (! is_null($this->command)) {
            $this->command->{$type}($message);
        }
    }
479522
function log(msg) {
        if (msg === void 0) { msg = ""; }
        return action(function (p) { console.log(msg); }).setType("log");
    }
1149907
public void handleMessage(String message, E_MessageType type, ST max100, Object appID){
		this.count++;

		boolean doMax = false;
		if(this.maxCount!=-1 && this.count>this.maxCount){
			max100.add("name", appID);
			max100.add("number", this.maxCount);
			doMax = true;
		}

		if(this.useSkbConsole==true){
			switch(type){
				case ERROR:
					MessageConsole.conError(message);
					if(doMax==true){
						MessageConsole.conError(max100.render());
					}
					break;
				case INFO:
					MessageConsole.conInfo(message);
					if(doMax==true){
						MessageConsole.conError(max100.render());
					}
					break;
				case WARNING:
					MessageConsole.conWarn(message);
					if(doMax==true){
						MessageConsole.conError(max100.render());
					}
					break;
			}
		}
		else{
			switch(type){
				case ERROR:
					this.logger.error(message);
					if(doMax==true){
						this.logger.error(max100.render());
					}
					break;
				case INFO:
					this.logger.info(message);
					if(doMax==true){
						this.logger.error(max100.render());
					}
					break;
				case WARNING:
					this.logger.warn(message);
					if(doMax==true){
						this.logger.error(max100.render());
					}
					break;
			}
		}
	}
1046229
function(type) {
		var Type = edb.Type.is(type) ? type.constructor : type;
		if (edb.get(Type) === type) {
			var input = this._configure(Type, null);
			gui.Broadcast.dispatch(edb.BROADCAST_OUTPUT, input);
			//edb.Type.$destruct(type);
			delete this._map[Type.$classid];
		}
	}