Class jQuery.sap.log.LoggerModule: jquery.sap.global


A Logger class


Since: 1.1.2.
Constructor Summary
new jQuery.sap.log.Logger(sDefaultComponent)Creates a new Logger instance which will use the given component string for all logged messages without a specific component.
Method Summary
debug(sMessage, sDetails?, sComponent?)Creates a new debug-level entry in the log with the given message, details and calling component.
error(sMessage, sDetails?, sComponent?)Creates a new error-level entry in the log with the given message, details and calling component.
fatal(sMessage, sDetails?, sComponent?)Creates a new fatal-level entry in the log with the given message, details and calling component.
getLevel(sComponent?)Returns the log level currently effective for the given component.
info(sMessage, sDetails?, sComponent?)Creates a new info-level entry in the log with the given message, details and calling component.
isLoggable(iLevel?, sComponent?)Checks whether logging is enabled for the given log level, depending on the currently effective log level for the given component.
setLevel(iLogLevel, sComponent?)Defines the maximum jQuery.sap.log.Level of log entries that will be recorded.
trace(sMessage, sDetails?, sComponent?)Creates a new trace-level entry in the log with the given message, details and calling component.
warning(sMessage, sDetails?, sComponent?)Creates a new warning-level entry in the log with the given message, details and calling component.
Constructor Detail
new jQuery.sap.log.Logger(sDefaultComponent)
Creates a new Logger instance which will use the given component string for all logged messages without a specific component.
Parameters:
{string}sDefaultComponent The component to use
Method Detail
debug(sMessage, sDetails?, sComponent?): jQuery.sap.log.Logger
Creates a new debug-level entry in the log with the given message, details and calling component.
Parameters:
{string}sMessage Message text to display
{string}sDetails?, Default: '' Details about the message, might be omitted
{string}sComponent?, Default: '' Name of the component that produced the log entry
Returns:
{jQuery.sap.log.Logger} The log instance
error(sMessage, sDetails?, sComponent?): jQuery.sap.log.Logger
Creates a new error-level entry in the log with the given message, details and calling component.
Parameters:
{string}sMessage Message text to display
{string}sDetails?, Default: '' Details about the message, might be omitted
{string}sComponent?, Default: '' Name of the component that produced the log entry
Returns:
{jQuery.sap.log.Logger} The log instance
fatal(sMessage, sDetails?, sComponent?): jQuery.sap.log.Logger
Creates a new fatal-level entry in the log with the given message, details and calling component.
Parameters:
{string}sMessage Message text to display
{string}sDetails?, Default: '' Details about the message, might be omitted
{string}sComponent?, Default: '' Name of the component that produced the log entry
Returns:
{jQuery.sap.log.Logger} The log instance for method chaining
getLevel(sComponent?): int
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.
Parameters:
{string}sComponent? Name of the component to retrieve the log level for
Since:
1.1.2
Returns:
{int} The log level for the given component or the default log level
info(sMessage, sDetails?, sComponent?): jQuery.sap.log.Logger
Creates a new info-level entry in the log with the given message, details and calling component.
Parameters:
{string}sMessage Message text to display
{string}sDetails?, Default: '' Details about the message, might be omitted
{string}sComponent?, Default: '' Name of the component that produced the log entry
Returns:
{jQuery.sap.log.Logger} The log instance
isLoggable(iLevel?, sComponent?): boolean
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.

Parameters:
{int}iLevel?, Default: Level.DEBUG The log level in question
{string}sComponent? Name of the component to check the log level for
Since:
1.13.2
Returns:
{boolean} Whether logging is enabled or not
setLevel(iLogLevel, sComponent?): jQuery.sap.log
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.

Parameters:
{jQuery.sap.log.Level}iLogLevel The new log level
{string}sComponent? The log component to set the log level for
Returns:
{jQuery.sap.log} This logger object to allow method chaining
trace(sMessage, sDetails?, sComponent?): jQuery.sap.log.Logger
Creates a new trace-level entry in the log with the given message, details and calling component.
Parameters:
{string}sMessage Message text to display
{string}sDetails?, Default: '' Details about the message, might be omitted
{string}sComponent?, Default: '' Name of the component that produced the log entry
Returns:
{jQuery.sap.log.Logger} The log-instance
warning(sMessage, sDetails?, sComponent?): jQuery.sap.log.Logger
Creates a new warning-level entry in the log with the given message, details and calling component.
Parameters:
{string}sMessage Message text to display
{string}sDetails?, Default: '' Details about the message, might be omitted
{string}sComponent?, Default: '' Name of the component that produced the log entry
Returns:
{jQuery.sap.log.Logger} The log instance