public class Logger
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
private boolean |
debugMode |
private java.nio.file.Path |
logFile |
Constructor and Description |
---|
Logger(java.lang.String logFile,
boolean debugMode)
Constructor with logFile.
|
Modifier and Type | Method and Description |
---|---|
void |
write(java.lang.Exception e,
LogLevel logLevel)
Appends log to filelog and print to stderr.
|
void |
write(java.lang.String text,
LogLevel logLevel)
Appends log to filelog and print to stderr.
|
void |
writeTCP(java.lang.Exception e,
LogLevel logLevel)
Appends log to filelog and print to stderr.
|
void |
writeTCP(java.lang.String text,
LogLevel logLevel)
Appends log to filelog and print to stderr.
|
void |
writeUDP(java.lang.Exception e,
LogLevel logLevel)
Appends log to filelog and print to stderr.
|
void |
writeUDP(java.lang.String text,
LogLevel logLevel)
Appends log to filelog and print to stderr.
|
public Logger(java.lang.String logFile, boolean debugMode)
logFile
- name of the file to store logs.debugMode
- Enable printing of debug levelpublic void write(java.lang.String text, LogLevel logLevel)
text
- Text to logpublic void write(java.lang.Exception e, LogLevel logLevel)
e
- Exception to loglogLevel
- Type of logpublic void writeTCP(java.lang.String text, LogLevel logLevel)
text
- Text to loglogLevel
- Type of logpublic void writeTCP(java.lang.Exception e, LogLevel logLevel)
e
- Exception to loglogLevel
- Type of logpublic void writeUDP(java.lang.String text, LogLevel logLevel)
text
- Text to loglogLevel
- Type of logpublic void writeUDP(java.lang.Exception e, LogLevel logLevel)
e
- Excetpino to loglogLevel
- Type of log