class jQuery.sap.log.Logger

Control sample: jQuery.sap.log.Logger
Visiblity: public
UX Guidelines:
Implements:
Available since: N/A
Extends:
Module: jquery.sap.global
Application Component: CA-UI5-COR

A Logger class


Constructor

Creates a new Logger instance which will use the given component string for all logged messages without a specific component.

new jQuery.sap.log.Logger(sDefaultComponent)
Param Type Default Value Description
sDefaultComponent string

The component to use


Methods Overview

Method Description
debug

Creates a new debug-level entry in the log with the given message, details and calling component.

error

Creates a new error-level entry in the log with the given message, details and calling component.

fatal

Creates a new fatal-level entry in the log with the given message, details and calling component.

getLevel

Returns the log level currently effective for the given component. If no component is given or when no level has been configured for a given component, the log level for the default component of this logger is returned.

info

Creates a new info-level entry in the log with the given message, details and calling component.

isLoggable

Checks whether logging is enabled for the given log level, depending on the currently effective log level for the given component.

If no component is given, the default component of this logger will be taken into account.

setLevel

Defines the maximum jQuery.sap.log.Level of log entries that will be recorded. Log entries with a higher (less important) log level will be omitted from the log. When a component name is given, the log level will be configured for that component only, otherwise the log level for the default component of this logger is set. For the global logger, the global default level is set.

Note: Setting a global default log level has no impact on already defined component log levels. They always override the global default log level.

trace

Creates a new trace-level entry in the log with the given message, details and calling component.

warning

Creates a new warning-level entry in the log with the given message, details and calling component.

debug

Creates a new debug-level entry in the log with the given message, details and calling component.

Param Type DefaultValue Description
sMessage string

Message text to display

sDetails string ''

Details about the message, might be omitted

sComponent string ''

Name of the component that produced the log entry

fnSupportInfo function

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 logSupportInfo(true). 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.

error

Creates a new error-level entry in the log with the given message, details and calling component.

Param Type DefaultValue Description
sMessage string

Message text to display

sDetails string ''

Details about the message, might be omitted

sComponent string ''

Name of the component that produced the log entry

fnSupportInfo function

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 logSupportInfo(true). 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.

fatal

Creates a new fatal-level entry in the log with the given message, details and calling component.

Param Type DefaultValue Description
sMessage string

Message text to display

sDetails string ''

Details about the message, might be omitted

sComponent string ''

Name of the component that produced the log entry

fnSupportInfo function

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 logSupportInfo(true). 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.

getLevel

Returns the log level currently effective for the given component. If no component is given or when no level has been configured for a given component, the log level for the default component of this logger is returned.

Param Type DefaultValue Description
sComponent string

Name of the component to retrieve the log level for

info

Creates a new info-level entry in the log with the given message, details and calling component.

Param Type DefaultValue Description
sMessage string

Message text to display

sDetails string ''

Details about the message, might be omitted

sComponent string ''

Name of the component that produced the log entry

fnSupportInfo function

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 logSupportInfo(true). 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.

isLoggable

Checks whether logging is enabled for the given log level, depending on the currently effective log level for the given component.

If no component is given, the default component of this logger will be taken into account.

Param Type DefaultValue Description
iLevel int Level.DEBUG

The log level in question

sComponent string

Name of the component to check the log level for

setLevel

Defines the maximum jQuery.sap.log.Level of log entries that will be recorded. Log entries with a higher (less important) log level will be omitted from the log. When a component name is given, the log level will be configured for that component only, otherwise the log level for the default component of this logger is set. For the global logger, the global default level is set.

Note: Setting a global default log level has no impact on already defined component log levels. They always override the global default log level.

Param Type DefaultValue Description
iLogLevel jQuery.sap.log.Level

The new log level

sComponent string

The log component to set the log level for

trace

Creates a new trace-level entry in the log with the given message, details and calling component.

Param Type DefaultValue Description
sMessage string

Message text to display

sDetails string ''

Details about the message, might be omitted

sComponent string ''

Name of the component that produced the log entry

fnSupportInfo function

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 logSupportInfo(true). 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.

warning

Creates a new warning-level entry in the log with the given message, details and calling component.

Param Type DefaultValue Description
sMessage string

Message text to display

sDetails string ''

Details about the message, might be omitted

sComponent string ''

Name of the component that produced the log entry

fnSupportInfo function

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 logSupportInfo(true). 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.