|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object velosurf.util.Logger
public class Logger
This class is the logger used by velosurf.
Field Summary | |
---|---|
private static int |
asyncLimit
max number of lines to log in asynchronous mode. |
(package private) static java.io.StringWriter |
asyncLog
asynchronous log used at start. |
private static boolean |
captureStderr
whether the logger captures stderr. |
private static boolean |
captureStdout
whether the logger captures stdout. |
static int |
DEBUG_ID
debug messages loglevel. |
private static boolean |
displayTimestamps
whether to display timestamps. |
static int |
ERROR_ID
error messages loglevel. |
static int |
FATAL_ID
fatal messages loglevel. |
(package private) static java.text.SimpleDateFormat |
format
date format for timestamps. |
static int |
INFO_ID
info messages loglevel. |
private static boolean |
initialized
Did someone give me an otput writer? |
(package private) static int |
lines
|
(package private) static java.io.PrintWriter |
log
log output printwriter. |
private static int |
logLevel
Current log level. |
private static MailNotifier |
notifier
|
private static int |
notifLevel
|
private static boolean |
notify
|
(package private) static java.io.PrintStream |
oldStderr
stderr old value. |
(package private) static java.io.PrintStream |
oldStdout
stdout old value. |
static int |
TRACE_ID
trace messages loglevel. |
static int |
WARN_ID
warn messages loglevel. |
Constructor Summary | |
---|---|
Logger()
|
Method Summary | |
---|---|
static void |
debug(java.lang.String s)
logs a debug string. |
static void |
dumpStack()
dumps the current stack. |
static void |
enableNotifications(boolean enable)
|
static void |
error(java.lang.String s)
logs an error string. |
static void |
fatal(java.lang.String s)
logs a fatal error string. |
private static void |
flushAsyncLog()
flush the asynchronous log in the output writer. |
static int |
getLogLevel()
Gets the current log level. |
static int |
getNotificationLevel()
|
static boolean |
getNotifierEnabled()
|
static java.io.PrintWriter |
getWriter()
get the output writer. |
private static java.lang.String |
header()
returns "Velosurf ". |
static void |
info(java.lang.String s)
logs an info string. |
static boolean |
isInitialized()
queries the initialized state. |
static void |
log(int level,
java.lang.String s)
log a string using a verbose level. |
private static void |
log(java.lang.String s)
logs a string. |
static void |
log(java.lang.String s,
java.lang.Throwable e)
logs an exception with a string. |
static void |
log(java.lang.Throwable e)
log an exception. |
static void |
log2File(java.lang.String file)
log to file. |
static void |
log2Stderr()
log to stderr. |
static void |
log2Stdout()
log to stdout. |
static void |
setDisplayTimestamps(boolean timestamps)
whether to display timestamps. |
static void |
setLogLevel(int logLevel)
Sets the log level. |
static void |
setNotificationLevel(int level)
|
static void |
setNotificationParams(java.lang.String host,
java.lang.String sender,
java.lang.String recipient)
|
static void |
setWriter(java.lang.Object out)
set the output writer. |
static void |
startCaptureStderr()
redirects stderr towards the output writer. |
static void |
startCaptureStdout()
redirects stdout towards output writer. |
static void |
stopCaptureStderr()
stops redirecting stderr. |
static void |
stopCaptureStdout()
stop redirecting stdout. |
static void |
trace(java.lang.String s)
logs a tracing string. |
static void |
warn(java.lang.String s)
logs a warning string. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final int TRACE_ID
public static final int DEBUG_ID
public static final int INFO_ID
public static final int WARN_ID
public static final int ERROR_ID
public static final int FATAL_ID
private static int logLevel
private static boolean displayTimestamps
private static boolean captureStdout
private static boolean captureStderr
private static int asyncLimit
private static boolean initialized
static java.text.SimpleDateFormat format
static java.io.StringWriter asyncLog
static java.io.PrintWriter log
static java.io.PrintStream oldStdout
static java.io.PrintStream oldStderr
static int lines
private static MailNotifier notifier
private static int notifLevel
private static boolean notify
Constructor Detail |
---|
public Logger()
Method Detail |
---|
public static void setLogLevel(int logLevel)
logLevel
- log levelpublic static void setDisplayTimestamps(boolean timestamps)
timestamps
- public static int getLogLevel()
private static void log(java.lang.String s)
s
- stringpublic static void log(java.lang.String s, java.lang.Throwable e)
s
- stringe
- exceptionpublic static void log(java.lang.Throwable e)
e
- exceptionpublic static void log(int level, java.lang.String s)
level
- verbose levels
- string to logpublic static void trace(java.lang.String s)
s
- tracing stringpublic static void debug(java.lang.String s)
s
- debug stringpublic static void info(java.lang.String s)
s
- info stringpublic static void warn(java.lang.String s)
s
- warning stringpublic static void error(java.lang.String s)
s
- error stringpublic static void fatal(java.lang.String s)
s
- fatal error stringpublic static java.io.PrintWriter getWriter()
public static void setWriter(java.lang.Object out)
out
- PrintWriter or Writer or OutputStreampublic static void startCaptureStdout()
public static void stopCaptureStdout()
public static void startCaptureStderr()
public static void stopCaptureStderr()
public static void log2Stdout()
public static void log2Stderr()
public static void log2File(java.lang.String file) throws java.io.FileNotFoundException, java.io.IOException
java.io.FileNotFoundException
java.io.IOException
private static java.lang.String header()
private static void flushAsyncLog()
public static boolean isInitialized()
public static void dumpStack()
public static void setNotificationParams(java.lang.String host, java.lang.String sender, java.lang.String recipient)
public static void setNotificationLevel(int level)
public static int getNotificationLevel()
public static void enableNotifications(boolean enable)
public static boolean getNotifierEnabled()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |