|
||||||||||
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 | |
---|---|
static int |
DEBUG_ID
Prefix for debug messages. |
static int |
ERROR_ID
Prefix for error messages. |
static int |
INFO_ID
Prefix for info messages. |
(package private) static int |
lines
|
static int |
mLogLevel
Current log level |
private static int |
sAsyncLimit
max number of lines to log in asynchronous mode |
(package private) static java.io.StringWriter |
sAsyncLog
asynchronous log used at start |
private static boolean |
sCaptureStderr
whether the logger captures stderr |
private static boolean |
sCaptureStdout
whether the logger captures stdout |
(package private) static java.text.SimpleDateFormat |
sFormat
date format for timestamps |
(package private) static java.io.PrintWriter |
sLog
log output printwriter |
(package private) static java.io.PrintStream |
sOldStderr
stderr old value |
(package private) static java.io.PrintStream |
sOldStdout
stdout old value |
static int |
TRACE_ID
Prefix for trace messages. |
static int |
WARN_ID
Prefix for warning messages. |
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 |
error(java.lang.String s)
logs an error string |
protected static void |
flushAsyncLog()
flush the asynchronous log in the output writer |
static int |
getLogLevel()
Gets the current log level |
static java.io.PrintWriter |
getWriter()
get the output writer |
protected static java.lang.String |
header()
returns "Velosurf " |
static void |
info(java.lang.String s)
logs an info string |
static void |
log(int level,
java.lang.String s)
log a string using a verbose level |
protected 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 |
log2Stderr()
log to stderr |
static void |
log2Stdout()
log to stdout |
static void |
setLogLevel(int inLogLevel)
Sets the log level |
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 int mLogLevel
private static boolean sCaptureStdout
private static boolean sCaptureStderr
private static int sAsyncLimit
static java.text.SimpleDateFormat sFormat
static java.io.StringWriter sAsyncLog
static java.io.PrintWriter sLog
static java.io.PrintStream sOldStdout
static java.io.PrintStream sOldStderr
static int lines
Constructor Detail |
---|
public Logger()
Method Detail |
---|
public static void setLogLevel(int inLogLevel)
inLogLevel
- log levelpublic static int getLogLevel()
protected 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 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()
protected static java.lang.String header()
protected static void flushAsyncLog()
public static void dumpStack()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |