public class GroovyLogger extends Object
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.
Modifier and Type | Method and Description |
---|---|
void |
error(String msg)
Throws an error and stops the script execution immediately.
|
boolean |
isDebugEnabled()
Check debug log is enabled
|
boolean |
isInfoEnabled()
Check info log is enabled
|
boolean |
isTraceEnabled()
Check info log is enabled
|
void |
logDebug(String msg)
Log a message at the DEBUG level
|
void |
logDebug(String format,
Object... arguments)
Log a message at the DEBUG level
|
void |
logError(String msg)
Log a message at the ERROR level
|
void |
logError(String format,
Object... arguments)
Log a message at the ERROR level
|
void |
logInfo(String msg)
Log a message at the INFO level
|
void |
logInfo(String format,
Object... arguments)
Log a message at the INFO level
|
void |
logTrace(String msg)
Log a message at the TRACE level
|
void |
logTrace(String format,
Object... arguments)
Log a message at the TRACE level
|
void |
logWarning(String msg)
Log a message at the WARN level
|
void |
logWarning(String format,
Object... arguments)
Log a message at the WARN level
|
void |
notifyError(String msg)
Send a error notification to the UI
|
void |
notifyError(String msg,
String parameters)
Send a error notification to the UI
|
void |
notifyInfo(String msg)
Send an info notification to the UI
|
void |
notifyInfo(String msg,
String parameters)
Send an info notification to the UI
|
void |
notifySuccess(String msg)
Send a success notification to the UI
|
void |
notifySuccess(String msg,
String parameters)
Send a success notification to the UI
|
void |
notifyWarning(String msg)
Send a warning notification to the UI
|
void |
notifyWarning(String heading,
List<Warning> mspWarnings)
Send list of warnings as a html table to UI
|
void |
notifyWarning(String msg,
String parameters)
Send a warning notification to the UI
|
public void error(String msg) throws IMCGroovyException
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.
msg
- The message string to be logged and sentIMCGroovyException
- The custom exception that will be thrownpublic boolean isDebugEnabled()
public boolean isInfoEnabled()
public boolean isTraceEnabled()
public void logDebug(String msg)
msg
- The message string to be loggedpublic void logDebug(String format, Object... arguments)
format
- The format string to be loggedarguments
- public void logError(String msg)
msg
- The message string to be loggedpublic void logError(String format, Object... arguments)
format
- The format string to be loggedarguments
- public void logInfo(String msg)
msg
- The message string to be loggedpublic void logInfo(String format, Object... arguments)
format
- The format string to be loggedarguments
- public void logTrace(String msg)
msg
- The message string to be loggedpublic void logTrace(String format, Object... arguments)
format
- The format string to be loggedarguments
- public void logWarning(String msg)
msg
- The message string to be loggedpublic void logWarning(String format, Object... arguments)
format
- The format string to be loggedarguments
- public void notifyError(String msg)
msg
- The message string to be sentpublic void notifyError(String msg, String parameters)
msg
- label keyparameters
- public void notifyInfo(String msg)
msg
- The message string to be sentpublic void notifyInfo(String msg, String parameters)
msg
- The message string to be sentpublic void notifySuccess(String msg)
msg
- The message string to be sentpublic void notifySuccess(String msg, String parameters)
msg
- The message string to be sentparameters
- public void notifyWarning(String msg)
msg
- The message string to be sentpublic void notifyWarning(String heading, List<Warning> mspWarnings)
heading
- The heading of the tablemspWarnings
- list of warning to show in html table