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();
			}

			if (iLogEntriesLimit) {
				if (aLog.length >= iLogEntriesLimit) {
					// Cap the amount of stored log messages by 30 percent
					discardLogEntries();
				}

				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 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 Firefox, console might not exist or 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:
						isDetailsError ? console.debug(logText, "\n", sDetails) : console.debug(logText);
						break;
					case Log.Level.TRACE:
						isDetailsError ? console.trace(logText, "\n", sDetails) : console.trace(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.
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 undefined is returned.

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


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 undefined is returned . If an Error is passed via sDetails the stack of the Error will be logged as a separate parameter in the proper console function for the matching log level .
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();
			}
			if (iLogEntriesLimit) {
				if (aLog.length >= iLogEntriesLimit) {
					discardLogEntries();
				}
				aLog.push(oLogEntry);
			}
			if (oListener) {
				oListener.onLogEntry(oLogEntry);
			}
			if (console) { 
				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) { 
							isDetailsError ? console.info(logText, "\n", sDetails) : console.info(logText);
						} else {
							isDetailsError ? console.log(logText, "\n", sDetails) : console.log(logText);
						}
						break;
					case Log.Level.DEBUG:
						isDetailsError ? console.debug(logText, "\n", sDetails) : console.debug(logText);
						break;
					case Log.Level.TRACE:
						isDetailsError ? console.trace(logText, "\n", sDetails) : console.trace(logText);
						break;
				}
				if (console.info && oLogEntry.supportInfo) {
					console.info(oLogEntry.supportInfo);
				}
			}
			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 ( ) ; } if ( iLogEntriesLimit ) { if ( aLog . length >= iLogEntriesLimit ) { discardLogEntries ( ) ; } aLog . push ( oLogEntry ) ; } if ( oListener ) { oListener . onLogEntry ( oLogEntry ) ; } if ( console ) { 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 ) { isDetailsError ? console . info ( logText , "\n" , sDetails ) : console . info ( logText ) ; } else { isDetailsError ? console . log ( logText , "\n" , sDetails ) : console . log ( logText ) ; } break ; case Log . Level . DEBUG : isDetailsError ? console . debug ( logText , "\n" , sDetails ) : console . debug ( logText ) ; break ; case Log . Level . TRACE : isDetailsError ? console . trace ( logText , "\n" , sDetails ) : console . trace ( logText ) ; break ; } if ( console . info && oLogEntry . supportInfo ) { console . info ( oLogEntry . supportInfo ) ; } } return oLogEntry ; } }
Creates a new log entry depending on its level and component.
Creates a new log entry depending on its level and component .
// Cap the amount of stored log messages by 30 percent /*
			 * 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 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 */ // in Firefox, console might not exist or it might even disappear // info not available in iOS simulator /*eslint-enable no-console */