public class Logger extends Object
- message string should always contain the class name and the method name: Logger.msg(1,"ItemFact::createDir() - LifeCycle DB created"); - use meaningfull abbreviation and also use the dash to separate the 'header' from the message! - each method should start with this 'method signature' debug: Logger.msg(1,"ItemFact::createDir() - path:" + path);
| Modifier and Type | Field and Description |
|---|---|
protected static SimpleTCPIPServer |
mConsole |
| Constructor and Description |
|---|
Logger() |
| Modifier and Type | Method and Description |
|---|---|
static void |
addLogStream(PrintStream console,
int logLevel)
Add a new log stream
|
static void |
closeConsole() |
static void |
debug(int level,
String msg,
Object... args)
Report information that will be useful for debugging.
|
static void |
debug(String msg)
Deprecated.
use debug method with level parameter
|
static void |
die(String msg,
Object... args)
Report FATAL error and call the shutdown hook of the process.
|
static boolean |
doLog(int logLevel)
Check whether the given logLevel would produce a log entry or not
|
static void |
error(String msg,
Object... args)
Report error (uses log level 0).
|
static void |
error(Throwable ex)
Report exception
|
static int |
getConsolePort() |
static int |
initConsole(String id) |
static void |
msg(int level,
String msg,
Object... args)
Report information that will be useful for debugging.
|
static void |
msg(String msg,
Object... args)
Report information that is important to log all the time (uses log level 0).
|
static void |
removeAll() |
static void |
removeLogStream(PrintStream console)
Remove exeisting log stream
|
static void |
warning(String msg,
Object... args)
Report warning (uses log level 0).
|
protected static SimpleTCPIPServer mConsole
public static boolean doLog(int logLevel)
logLevel - the level to be checked@Deprecated public static void debug(String msg)
msg - - the string to write to the console, or log file if specified in cmd linepublic static void debug(int level,
String msg,
Object... args)
level - - log level of this message. If the current log level was set less that this number,
the log message will not be displayedmsg - - the string to write to the log. It can also use String.format() syntaxargs - - Arguments referenced by the format specifiers in the msg stringpublic static void msg(int level,
String msg,
Object... args)
level - - log level of this message. If the current log level was set less that this number,
the log message will not be displayedmsg - - the string to write to the log. It can also use String.format() syntaxargs - - Arguments referenced by the format specifiers in the msg stringpublic static void msg(String msg, Object... args)
msg - - the string to write to the log. It can also use String.format() syntaxargs - - Arguments referenced by the format specifiers in the msg stringpublic static void error(String msg, Object... args)
msg - - the string to write to the log. It can also use String.format() syntaxargs - - Arguments referenced by the format specifiers in the msg stringpublic static void error(Throwable ex)
ex - the Throwable to be loggedpublic static void warning(String msg, Object... args)
msg - - the string to write to the log. It can also use String.format() syntaxargs - - Arguments referenced by the format specifiers in the msg stringpublic static void die(String msg, Object... args)
msg - - the string to write to the log. It can also use String.format() syntaxargs - - Arguments referenced by the format specifiers in the msg stringpublic static void addLogStream(PrintStream console, int logLevel)
console - the PrintStream to be used as consolelogLevel - the log level to be used for this streampublic static void removeLogStream(PrintStream console)
console - the PrintStream to be used as consolepublic static int initConsole(String id)
public static int getConsolePort()
public static void closeConsole()
public static void removeAll()
Copyright © 1997–2019 CRISTAL-iSE. All rights reserved.