public final class Amanuensis
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ERRORS_LOG
Name of default error's log.
|
Modifier and Type | Method and Description |
---|---|
void |
addAtLog(java.lang.String logName,
java.lang.String text)
Add a line of text in "logName" log.
|
void |
clearAllLogs()
ATTENTION!
|
java.util.Map<java.lang.String,java.util.List<java.lang.String>> |
getAllLogs()
Return the map of all logs stored in amanuensis.
|
static Amanuensis |
getInstance()
Unique method to get the singleton instance of Amanuensis class.
|
java.util.List<java.lang.String> |
getLog(java.lang.String logName)
Returns list of log's lines if stored in Amanuensis logs.
|
void |
saveAllLogs()
Save all logs in a file, with default path (logs/).
|
void |
saveAllLogs(java.lang.String filePath)
Save all logs in a file, with path passed as parameter.
|
void |
saveLog(java.lang.String logName)
Save only a log passed as parameter, with default path (logs/).
|
void |
saveLog(java.lang.String logName,
java.lang.String dirPath)
Save only a log passed as parameter, with path passed in input.
|
public static final java.lang.String ERRORS_LOG
public static Amanuensis getInstance()
public java.util.Map<java.lang.String,java.util.List<java.lang.String>> getAllLogs()
public void addAtLog(java.lang.String logName, java.lang.String text)
logName
- name of the logtext
- text to be addpublic java.util.List<java.lang.String> getLog(java.lang.String logName)
logName
- name of the logpublic void saveAllLogs()
public void saveAllLogs(java.lang.String filePath)
filePath
- absolute or relative path where logs will be savedpublic void saveLog(java.lang.String logName)
logName
- Name of log to be savedpublic void saveLog(java.lang.String logName, java.lang.String dirPath)
logName
- Name of log to be saveddirPath
- Path of the directory where method will save the log (either relative or absolute)public void clearAllLogs()