Package com.piketec.tpt.api
Class Log
- java.lang.Object
-
- com.piketec.tpt.api.Log
-
- All Implemented Interfaces:
java.io.Serializable
public class Log extends java.lang.Object implements java.io.Serializable
A Log is a list of messages where each messages has aLog.LogType
.- Author:
- Copyright (c) 2014-2024 Piketec GmbH - MIT License (MIT) - All rights reserved
- See Also:
- Serialized Form
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
Log.LogEntry
A log message and itsLog.LogType
.static class
Log.LogType
The log type or severity of a log message.
-
Field Summary
Fields Modifier and Type Field Description protected java.util.List<Log.LogEntry>
entries
protected int
errorCount
protected int
infoCount
protected int
warningCount
-
Constructor Summary
Constructors Constructor Description Log()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addError(java.lang.String message)
Adds a new log entry withLog.LogType.ERROR
void
addInfo(java.lang.String message)
Adds a new log entry withLog.LogType.INFO
void
addWarning(java.lang.String message)
Adds a new log entry withLog.LogType.WARNING
java.util.List<Log.LogEntry>
getEntries()
int
getErrorCount()
int
getInfoCount()
int
getWarningCount()
java.lang.String
toString()
-
-
-
Field Detail
-
entries
protected java.util.List<Log.LogEntry> entries
-
errorCount
protected int errorCount
-
warningCount
protected int warningCount
-
infoCount
protected int infoCount
-
-
Method Detail
-
addError
public void addError(java.lang.String message)
Adds a new log entry withLog.LogType.ERROR
- Parameters:
message
- The message text
-
getErrorCount
public int getErrorCount()
- Returns:
- The amout of error messages contained in this log.
-
addWarning
public void addWarning(java.lang.String message)
Adds a new log entry withLog.LogType.WARNING
- Parameters:
message
- The message text
-
getWarningCount
public int getWarningCount()
- Returns:
- The amout of warning messages contained in this log.
-
addInfo
public void addInfo(java.lang.String message)
Adds a new log entry withLog.LogType.INFO
- Parameters:
message
- The message text
-
getInfoCount
public int getInfoCount()
- Returns:
- The amout of info messages contained in this log.
-
getEntries
public java.util.List<Log.LogEntry> getEntries()
- Returns:
- all log entries of all
LogTypes
of this log as an unmodifiable list.
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
-