Class MyLogger
- java.lang.Object
-
- org.teichert.databaseexplorer.utils.MyLogger
-
public final class MyLogger extends Object
Helper-class to provice logging methods which can be configured inConfigurationLoggigDialog
and uses translations provided byLocalizeController
.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
MyLogger.ILogType
This interface represents a LogType which has to be used to enhance the LogType-enum if custom-logging-behaviour is needed.static class
MyLogger.LogType
static class
MyLogger.Time
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static MyLogger
getInstance()
boolean
log(String filename, MyLogger.Time time, String message)
Logs the given message and save it into the given filename.
Time determines the interval if a new file needs to be created or reuse a existing one.
It will also be used for the files name at the end.void
logging(MyLogger.ILogType logType, String message)
Creates a log file as configured, if it is not disabled.void
logging(MyLogger.ILogType logType, String message, SQLDatabase db)
Creates a log file as configured, if it is not disabled.void
logIfIsDebug(String message)
-
-
-
Field Detail
-
FORMAT
public static final String FORMAT
- See Also:
- Constant Field Values
-
-
Method Detail
-
getInstance
public static MyLogger getInstance()
-
logIfIsDebug
public void logIfIsDebug(String message)
-
logging
public void logging(MyLogger.ILogType logType, String message) throws Exception
Creates a log file as configured, if it is not disabled.- Parameters:
logType
- = Enum from MyLogger-Class. Describes the type of the log.message
- = Describes the content of the log file- Throws:
Exception
-
logging
public void logging(MyLogger.ILogType logType, String message, @Nullable SQLDatabase db) throws Exception
Creates a log file as configured, if it is not disabled.- Parameters:
logType
- = Enum from MyLogger-Class. Describes the type of the log.message
- = Describes the content of the log filedb
- = Describes the database which was being used, can also be null, if the log is not SQL / HQL!- Throws:
Exception
-
log
public boolean log(String filename, MyLogger.Time time, String message) throws Exception
Logs the given message and save it into the given filename.
Time determines the interval if a new file needs to be created or reuse a existing one.
It will also be used for the files name at the end.- Parameters:
filename
-time
-message
-- Returns:
- Throws:
Exception
-
-