public class LogMessage extends Object
| Constructor and Description |
|---|
LogMessage(Class<?> clazz,
String method,
String logMessage,
String localizeKey)
Creates a new LogMessage.
|
LogMessage(Class<?> clazz,
String method,
String logMessage,
String localizeKey,
boolean forceMessagebox)
Creates a new LogMessage.
|
| Modifier and Type | Method and Description |
|---|---|
boolean |
addToLog() |
void |
disableUserNotification()
When this method is called on a LogMessage before it gets processed by the log-manager, no
messagebox will be shown to the user but the error message will still appear in the log file.
|
Class<?> |
getCausingClass() |
String |
getLocalizeKey() |
String |
getMessage() |
String |
getMethod() |
Map<String,String> |
getReplacements() |
boolean |
informUser() |
boolean |
isForceMessagebox() |
LogMessage |
withReplacement(String key,
String value)
Convenience method to set a single replacement string.
|
LogMessage |
withReplacements(Map<String,String> stringsToReplace)
Adds the map with strings to replace to this instance of LogMessage.
|
public LogMessage(Class<?> clazz, String method, String logMessage, String localizeKey)
clazz - class the message was caused inmethod - name of method the message was caused inlogMessage - message text or null if no log entry is neededlocalizeKey - key of the localized message for the user or null if no message box to the user is
neededpublic LogMessage(Class<?> clazz, String method, String logMessage, String localizeKey, boolean forceMessagebox)
clazz - class the message was caused inmethod - name of method the message was caused inlogMessage - message text or null if no log entry is neededlocalizeKey - key of the localized message for the user or null if no message box to the user is
neededforceMessagebox - if true, a messagebox will be shown regardless of severity (by default, only error-
messages are shown to the user)public LogMessage withReplacements(Map<String,String> stringsToReplace)
stringsToReplace - strings to replacepublic LogMessage withReplacement(String key, String value)
key - key to replacevalue - value to replace the key withpublic Class<?> getCausingClass()
public String getMethod()
public String getMessage()
public String getLocalizeKey()
public boolean addToLog()
public boolean informUser()
public Map<String,String> getReplacements()
public boolean isForceMessagebox()
public void disableUserNotification()
Copyright © 2016 SAPERION AG. All rights reserved.