Package com.imc.iss.groovy
Class GroovyLogger
java.lang.Object
com.imc.iss.groovy.GroovyLogger
This class allows logging and sending notifications from within the groovy
script.
This class is automatically provided inside all scripts and can be accessed as a variable named groovyLogger
Note that for a log of a particular level to be written, the corresponding log level for this class has to be set. This can be done through the HANA cockpit.
-
Method Summary
Modifier and TypeMethodDescriptionvoidThrows an error and stops the script execution immediately.booleanCheck debug log is enabledbooleanCheck info log is enabledbooleanCheck info log is enabledvoidLog a message at the DEBUG levelvoidLog a message at the DEBUG levelvoidLog a message at the ERROR levelvoidLog a message at the ERROR levelvoidLog a message at the INFO levelvoidLog a message at the INFO levelvoidLog a message at the TRACE levelvoidLog a message at the TRACE levelvoidlogWarning(String msg) Log a message at the WARN levelvoidlogWarning(String format, Object... arguments) Log a message at the WARN levelvoidnotifyError(String msg) Send a error notification to the UIvoidnotifyError(String msg, String parameters) Send a error notification to the UIvoidnotifyInfo(String msg) Send an info notification to the UIvoidnotifyInfo(String msg, String parameters) Send an info notification to the UIvoidnotifySuccess(String msg) Send a success notification to the UIvoidnotifySuccess(String msg, String parameters) Send a success notification to the UIvoidnotifyWarning(String msg) Send a warning notification to the UIvoidnotifyWarning(String msg, String parameters) Send a warning notification to the UIvoidnotifyWarning(String heading, List<Warning> mspWarnings) Send list of warnings as a html table to UI
-
Method Details
-
error
Throws an error and stops the script execution immediately.Any subsequent handling by the system that are normally done after the script completes will be stopped as well.
This will automatically logs the message at the ERROR level, as well as send out an error notification.
- Parameters:
msg- The message string to be logged and sent- Throws:
IMCGroovyException- The custom exception that will be thrown
-
isDebugEnabled
public boolean isDebugEnabled()Check debug log is enabled- Returns:
- status as boolean
-
isInfoEnabled
public boolean isInfoEnabled()Check info log is enabled- Returns:
- status as boolean
-
isTraceEnabled
public boolean isTraceEnabled()Check info log is enabled- Returns:
- status as boolean
-
logDebug
Log a message at the DEBUG level- Parameters:
msg- The message string to be logged
-
logDebug
Log a message at the DEBUG level- Parameters:
format- The format string to be loggedarguments-
-
logError
Log a message at the ERROR level- Parameters:
msg- The message string to be logged
-
logError
Log a message at the ERROR level- Parameters:
format- The format string to be loggedarguments-
-
logInfo
Log a message at the INFO level- Parameters:
msg- The message string to be logged
-
logInfo
Log a message at the INFO level- Parameters:
format- The format string to be loggedarguments-
-
logTrace
Log a message at the TRACE level- Parameters:
msg- The message string to be logged
-
logTrace
Log a message at the TRACE level- Parameters:
format- The format string to be loggedarguments-
-
logWarning
Log a message at the WARN level- Parameters:
msg- The message string to be logged
-
logWarning
Log a message at the WARN level- Parameters:
format- The format string to be loggedarguments-
-
notifyError
Send a error notification to the UI- Parameters:
msg- The message string to be sent
-
notifyError
Send a error notification to the UI- Parameters:
msg- label keyparameters-
-
notifyInfo
Send an info notification to the UI- Parameters:
msg- The message string to be sent
-
notifyInfo
Send an info notification to the UI- Parameters:
msg- The message string to be sent
-
notifySuccess
Send a success notification to the UI- Parameters:
msg- The message string to be sent
-
notifySuccess
Send a success notification to the UI- Parameters:
msg- The message string to be sentparameters-
-
notifyWarning
Send a warning notification to the UI- Parameters:
msg- The message string to be sent
-
notifyWarning
Send list of warnings as a html table to UI- Parameters:
heading- The heading of the tablemspWarnings- list of warning to show in html table
-
notifyWarning
Send a warning notification to the UI- Parameters:
msg- The message string to be sentparameters-
-