src/sap.ui.core/src/sap/base/Log.js
function log(iLevel, sMessage, sDetails, sComponent, fnSupportInfo) {
		if (!fnSupportInfo && !sComponent && typeof sDetails === "function") {
			fnSupportInfo = sDetails;
			sDetails = "";
		}
		if (!fnSupportInfo && typeof sComponent === "function") {
			fnSupportInfo = sComponent;
			sComponent = "";
		}

		sComponent = sComponent || sDefaultComponent;
		if (iLevel <= level(sComponent) ) {
			var fNow =  now(),
				oNow = new Date(fNow),
				iMicroSeconds = Math.floor((fNow - Math.floor(fNow)) * 1000),
				oLogEntry = {
					time     : pad0(oNow.getHours(),2) + ":" + pad0(oNow.getMinutes(),2) + ":" + pad0(oNow.getSeconds(),2) + "." + pad0(oNow.getMilliseconds(),3) + pad0(iMicroSeconds,3),
					date     : pad0(oNow.getFullYear(),4) + "-" + pad0(oNow.getMonth() + 1,2) + "-" + pad0(oNow.getDate(),2),
					timestamp: fNow,
					level    : iLevel,
					message  : String(sMessage || ""),
					details  : String(sDetails || ""),
					component: String(sComponent || "")
				};
			if (bLogSupportInfo && typeof fnSupportInfo === "function") {
				oLogEntry.supportInfo = fnSupportInfo();
			}
			aLog.push( oLogEntry );
			if (oListener) {
				oListener.onLogEntry(oLogEntry);
			}

			/*
			 * Console Log, also tries to log to the console, if available.
			 *
			 * Unfortunately, the support for console is quite different between the UI5 browsers. The most important differences are:
			 * - in IE (checked until IE9), the console object does not exist in a window, until the developer tools are opened for that window.
			 *   After opening the dev tools, the console remains available even when the tools are closed again. Only using a new window (or tab)
			 *   restores the old state without console.
			 *   When the console is available, it provides most standard methods, but not debug and trace
			 * - in FF3.6 the console is not available, until FireBug is opened. It disappears again, when fire bug is closed.
			 *   But when the settings for a web site are stored (convenience), the console remains open
			 *   When the console is available, it supports all relevant methods
			 * - in FF9.0, the console is always available, but method assert is only available when firebug is open
			 * - in Webkit browsers, the console object is always available and has all required methods
			 *   - Exception: in the iOS Simulator, console.info() does not exist
			 */
			/*eslint-disable no-console */
			if (console) { // in IE and FF, console might not exist; in FF it might even disappear
				var isDetailsError = sDetails instanceof Error,
					logText = oLogEntry.date + " " + oLogEntry.time + " " + oLogEntry.message + " - " + oLogEntry.details + " " + oLogEntry.component;
				switch (iLevel) {
					case Log.Level.FATAL:
					case Log.Level.ERROR: isDetailsError ? console.error(logText, "\n", sDetails) : console.error(logText); break;
					case Log.Level.WARNING: isDetailsError ? console.warn(logText, "\n", sDetails) : console.warn(logText); break;
					case Log.Level.INFO:
						if (console.info) { // info not available in iOS simulator
							isDetailsError ? console.info(logText, "\n", sDetails) : console.info(logText);
						} else {
							isDetailsError ? console.log(logText, "\n", sDetails) : console.log(logText);
						}
						break;
					case Log.Level.DEBUG:
						if (console.debug) { // debug not available in IE, fallback to log
							isDetailsError ? console.debug(logText, "\n", sDetails) : console.debug(logText);
						} else {
							isDetailsError ? console.log(logText, "\n", sDetails) : console.log(logText);
						}
						break;
					case Log.Level.TRACE:
						if (console.trace) { // trace not available in IE, fallback to log (no trace)
							isDetailsError ? console.trace(logText, "\n", sDetails) : console.trace(logText);
						} else {
							isDetailsError ? console.log(logText, "\n", sDetails) : console.log(logText);
						}
						break;
				}
				if (console.info && oLogEntry.supportInfo) {
					console.info(oLogEntry.supportInfo);
				}
			}
			/*eslint-enable no-console */
			return oLogEntry;
		}
	}
function log(iLevel, sMessage, sDetails, sComponent, fnSupportInfo) {
		if (!fnSupportInfo && !sComponent && typeof sDetails === "function") {
			fnSupportInfo = sDetails;
			sDetails = "";
		}
		if (!fnSupportInfo && typeof sComponent === "function") {
			fnSupportInfo = sComponent;
			sComponent = "";
		}

		sComponent = sComponent || sDefaultComponent;
		if (iLevel <= level(sComponent) ) {
			var fNow =  now(),
				oNow = new Date(fNow),
				iMicroSeconds = Math.floor((fNow - Math.floor(fNow)) * 1000),
				oLogEntry = {
					time     : pad0(oNow.getHours(),2) + ":" + pad0(oNow.getMinutes(),2) + ":" + pad0(oNow.getSeconds(),2) + "." + pad0(oNow.getMilliseconds(),3) + pad0(iMicroSeconds,3),
					date     : pad0(oNow.getFullYear(),4) + "-" + pad0(oNow.getMonth() + 1,2) + "-" + pad0(oNow.getDate(),2),
					timestamp: fNow,
					level    : iLevel,
					message  : String(sMessage || ""),
					details  : String(sDetails || ""),
					component: String(sComponent || "")
				};
			if (bLogSupportInfo && typeof fnSupportInfo === "function") {
				oLogEntry.supportInfo = fnSupportInfo();
			}
			aLog.push( oLogEntry );
			if (oListener) {
				oListener.onLogEntry(oLogEntry);
			}

			/*
			 * Console Log, also tries to log to the console, if available.
			 *
			 * Unfortunately, the support for console is quite different between the UI5 browsers. The most important differences are:
			 * - in IE (checked until IE9), the console object does not exist in a window, until the developer tools are opened for that window.
			 *   After opening the dev tools, the console remains available even when the tools are closed again. Only using a new window (or tab)
			 *   restores the old state without console.
			 *   When the console is available, it provides most standard methods, but not debug and trace
			 * - in FF3.6 the console is not available, until FireBug is opened. It disappears again, when fire bug is closed.
			 *   But when the settings for a web site are stored (convenience), the console remains open
			 *   When the console is available, it supports all relevant methods
			 * - in FF9.0, the console is always available, but method assert is only available when firebug is open
			 * - in Webkit browsers, the console object is always available and has all required methods
			 *   - Exception: in the iOS Simulator, console.info() does not exist
			 */
			/*eslint-disable no-console */
			if (console) { // in IE and FF, console might not exist; in FF it might even disappear
				var isDetailsError = sDetails instanceof Error,
					logText = oLogEntry.date + " " + oLogEntry.time + " " + oLogEntry.message + " - " + oLogEntry.details + " " + oLogEntry.component;
				switch (iLevel) {
					case Log.Level.FATAL:
					case Log.Level.ERROR: isDetailsError ? console.error(logText, "\n", sDetails) : console.error(logText); break;
					case Log.Level.WARNING: isDetailsError ? console.warn(logText, "\n", sDetails) : console.warn(logText); break;
					case Log.Level.INFO:
						if (console.info) { // info not available in iOS simulator
							isDetailsError ? console.info(logText, "\n", sDetails) : console.info(logText);
						} else {
							isDetailsError ? console.log(logText, "\n", sDetails) : console.log(logText);
						}
						break;
					case Log.Level.DEBUG:
						if (console.debug) { // debug not available in IE, fallback to log
							isDetailsError ? console.debug(logText, "\n", sDetails) : console.debug(logText);
						} else {
							isDetailsError ? console.log(logText, "\n", sDetails) : console.log(logText);
						}
						break;
					case Log.Level.TRACE:
						if (console.trace) { // trace not available in IE, fallback to log (no trace)
							isDetailsError ? console.trace(logText, "\n", sDetails) : console.trace(logText);
						} else {
							isDetailsError ? console.log(logText, "\n", sDetails) : console.log(logText);
						}
						break;
				}
				if (console.info && oLogEntry.supportInfo) {
					console.info(oLogEntry.supportInfo);
				}
			}
			/*eslint-enable no-console */
			return oLogEntry;
		}
	}
function log ( iLevel , sMessage , sDetails , sComponent , fnSupportInfo ) { if ( ! fnSupportInfo && ! sComponent && typeof sDetails === "function" ) { fnSupportInfo = sDetails ; sDetails = "" ; } if ( ! fnSupportInfo && typeof sComponent === "function" ) { fnSupportInfo = sComponent ; sComponent = "" ; } sComponent = sComponent || sDefaultComponent ; if ( iLevel <= level ( sComponent ) ) { var fNow = now ( ) , oNow = new Date ( fNow ) , iMicroSeconds = Math . floor ( ( fNow - Math . floor ( fNow ) ) * 1000 ) , oLogEntry = { time : pad0 ( oNow . getHours ( ) , 2 ) + ":" + pad0 ( oNow . getMinutes ( ) , 2 ) + ":" + pad0 ( oNow . getSeconds ( ) , 2 ) + "." + pad0 ( oNow . getMilliseconds ( ) , 3 ) + pad0 ( iMicroSeconds , 3 ) , date : pad0 ( oNow . getFullYear ( ) , 4 ) + "-" + pad0 ( oNow . getMonth ( ) + 1 , 2 ) + "-" + pad0 ( oNow . getDate ( ) , 2 ) , timestamp : fNow , level : iLevel , message : String ( sMessage || "" ) , details : String ( sDetails || "" ) , component : String ( sComponent || "" ) } ; if ( bLogSupportInfo && typeof fnSupportInfo === "function" ) { oLogEntry . supportInfo = fnSupportInfo ( ) ; } aLog . push ( oLogEntry ) ; if ( oListener ) { oListener . onLogEntry ( oLogEntry ) ; } /*
			 * Console Log, also tries to log to the console, if available.
			 *
			 * Unfortunately, the support for console is quite different between the UI5 browsers. The most important differences are:
			 * - in IE (checked until IE9), the console object does not exist in a window, until the developer tools are opened for that window.
			 *   After opening the dev tools, the console remains available even when the tools are closed again. Only using a new window (or tab)
			 *   restores the old state without console.
			 *   When the console is available, it provides most standard methods, but not debug and trace
			 * - in FF3.6 the console is not available, until FireBug is opened. It disappears again, when fire bug is closed.
			 *   But when the settings for a web site are stored (convenience), the console remains open
			 *   When the console is available, it supports all relevant methods
			 * - in FF9.0, the console is always available, but method assert is only available when firebug is open
			 * - in Webkit browsers, the console object is always available and has all required methods
			 *   - Exception: in the iOS Simulator, console.info() does not exist
			 */ /*eslint-disable no-console */ if ( console ) { // in IE and FF, console might not exist; in FF it might even disappear var isDetailsError = sDetails instanceof Error , logText = oLogEntry . date + " " + oLogEntry . time + " " + oLogEntry . message + " - " + oLogEntry . details + " " + oLogEntry . component ; switch ( iLevel ) { case Log . Level . FATAL : case Log . Level . ERROR : isDetailsError ? console . error ( logText , "\n" , sDetails ) : console . error ( logText ) ; break ; case Log . Level . WARNING : isDetailsError ? console . warn ( logText , "\n" , sDetails ) : console . warn ( logText ) ; break ; case Log . Level . INFO : if ( console . info ) { // info not available in iOS simulator isDetailsError ? console . info ( logText , "\n" , sDetails ) : console . info ( logText ) ; } else { isDetailsError ? console . log ( logText , "\n" , sDetails ) : console . log ( logText ) ; } break ; case Log . Level . DEBUG : if ( console . debug ) { // debug not available in IE, fallback to log isDetailsError ? console . debug ( logText , "\n" , sDetails ) : console . debug ( logText ) ; } else { isDetailsError ? console . log ( logText , "\n" , sDetails ) : console . log ( logText ) ; } break ; case Log . Level . TRACE : if ( console . trace ) { // trace not available in IE, fallback to log (no trace) isDetailsError ? console . trace ( logText , "\n" , sDetails ) : console . trace ( logText ) ; } else { isDetailsError ? console . log ( logText , "\n" , sDetails ) : console . log ( logText ) ; } break ; } if ( console . info && oLogEntry . supportInfo ) { console . info ( oLogEntry . supportInfo ) ; } } /*eslint-enable no-console */ return oLogEntry ; } }
Creates a new log entry depending on its level and component.

If the given level is higher than the max level for the given component
(or higher than the global level, if no component is given),
then no entry is created and <code>undefined</code> is returned.

If an <code>Error</code> is passed via <code>sDetails</code> the stack
of the <code>Error</code> will be logged as a separate parameter in
the proper <code>console</code> function for the matching log level.

@param {module:sap/base/Log.Level} iLevel One of the log levels FATAL, ERROR, WARNING, INFO, DEBUG, TRACE
@param {string} sMessage The message to be logged
@param {string|Error} [sDetails] The optional details for the message; could be an Error which will be logged with the stack to easily find the root cause of the Error
@param {string} [sComponent] The log component under which the message should be logged
@param {function} [fnSupportInfo] Callback that returns an additional support object to be logged in support mode.
This function is only called if support info mode is turned on with <code>logSupportInfo(true)</code>.
To avoid negative effects regarding execution times and memory consumption, the returned object should be a simple
immutable JSON object with mostly static and stable content.
@returns {object} The log entry as an object or <code>undefined</code> if no entry was created
@private
Creates a new log entry depending on its level and component .