Package com.inet.html.utils
Class Logger
java.lang.Object
com.inet.html.utils.Logger
The logger of the InetHtml Project
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic final voidLogs a critical errorstatic final voidLogs a critical exceptionstatic final voidLogs a debug messagestatic booleandoesLog(int level) Checks the log levelstatic final voidLogs an error messagestatic final voidLogs a exceptionstatic intReturns the number of critical errors since the last resetstatic intReturns the number of errors since the last resetstatic intReturns the current log levelstatic intReturns the number of warnings since the last resetstatic final voidLogs a user informationstatic voidreset()Resets the internal error coutnersstatic voidsetAuxConsoleMode(boolean activate) Activates a stand-alone frame with a logger consolestatic voidsetLogLevel(int level) Set the log levelstatic voidsetLogStream(PrintStream stream) Set a custom log output stream.static final voidLogs a warningstatic final voidLogs a exception
-
Field Details
-
SILENT
public static final int SILENT- See Also:
-
CRITICAL
public static final int CRITICAL- See Also:
-
ERROR
public static final int ERROR- See Also:
-
WARNING
public static final int WARNING- See Also:
-
INFO
public static final int INFO- See Also:
-
DEBUG
public static final int DEBUG- See Also:
-
-
Constructor Details
-
Logger
public Logger()
-
-
Method Details
-
doesLog
public static boolean doesLog(int level) Checks the log level- Parameters:
level- the desired level- Returns:
- true, if a message with the desired level would be printed
-
critical
Logs a critical error- Parameters:
msg- the log message
-
critical
Logs a critical exception- Parameters:
t- the log message
-
error
Logs an error message- Parameters:
msg- the error message
-
error
Logs a exception- Parameters:
t- the log message
-
warning
Logs a warning- Parameters:
msg- the log message
-
warning
Logs a exception- Parameters:
t- the log message
-
info
Logs a user information- Parameters:
msg- the log message
-
debug
Logs a debug message- Parameters:
msg- the log message
-
setLogLevel
public static void setLogLevel(int level) Set the log level -
getLogLevel
public static int getLogLevel()Returns the current log level -
reset
public static void reset()Resets the internal error coutners -
getCriticals
public static int getCriticals()Returns the number of critical errors since the last reset- Returns:
- the number of critical errors since the last reset
-
getErrors
public static int getErrors()Returns the number of errors since the last reset- Returns:
- the number of errors since the last reset
-
getWarnings
public static int getWarnings()Returns the number of warnings since the last reset- Returns:
- the number of warnings errors since the last reset
-
setAuxConsoleMode
public static void setAuxConsoleMode(boolean activate) Activates a stand-alone frame with a logger console- Parameters:
activate- true to activate, false to switch to System.out logging
-
setLogStream
Set a custom log output stream.- Parameters:
stream- the stream, never null
-