|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectwater.util.Log
public abstract class Log
Log for H2O. This class should be loaded before we start to print as it wraps around System.{out,err}. There are three kinds of message: INFO, WARN and ERRR, for general information, events that look wrong, and runtime exceptions. WARN messages and uncaught exceptions are printed on Standard output. Some INFO messages are also printed on standard output. Many more messages are printed to the log file in the ice directory and to the K/V store. Messages can come from a number of subsystems, Sys.RANDF for instance denotes the Random forest implementation. Subsystem names are five letter mnemonics to keep formatting nicely even. To print messages from a subsystem to the log file, set a property on the command line -Dlog.RANDF=true -Dlog.RANDF=false // turn off or call the API function Log.setFlag(Sys.RANDF); Log.unsetFlag(Sys.RANDF); // turn off OOME: when the VM is low on memory, OutOfMemoryError can be thrown in the logging framework while it is trying to print a message. In this case the first message that fails is recorded for later printout, and a number of messages can be discarded. The framework will attempt to print the recorded message later, and report the number of dropped messages, but this done in a best effort and lossy manner. Basically when an OOME occurs during logging, no guarantees are made about the messages.
Nested Class Summary | |
---|---|
static class |
Log.LogStr
|
static interface |
Log.Tag
Tags for log messages |
static class |
Log.Wrapper
|
Field Summary | |
---|---|
static boolean |
_dontDie
|
static Log.Tag.Kind[] |
KINDS
|
static Key |
LOG_KEY
Key for the log in the KV store |
static long |
PID
Some guess at the process ID. |
static Log.Tag.Sys[] |
SYSS
|
Constructor Summary | |
---|---|
Log()
|
Method Summary | ||
---|---|---|
static void |
debug(Log.Tag.Sys t,
java.lang.Object... objects)
Log a debug message to the log file and the store if the subsystem's flag is set. |
|
static void |
debug(java.lang.Object... objects)
Log a debug message to the log file and the store if the subsystem's flag is set. |
|
static void |
die(java.lang.String s)
|
|
static void |
err(Log.Tag.Sys t,
java.lang.String msg)
Record a message to the log file and store. |
|
static
|
err(Log.Tag.Sys t,
java.lang.String msg,
T exception)
Record an exception to the log file and store. |
|
static
|
err(Log.Tag.Sys t,
T exception)
Record an exception to the log file and store. |
|
static void |
err(java.lang.String msg)
Record a message to the log file and store. |
|
static
|
err(java.lang.String msg,
T exception)
Record an exception to the log file and store. |
|
static
|
err(T exception)
Record an exception to the log file and store. |
|
static java.lang.RuntimeException |
errRTExcept(java.lang.Throwable exception)
Record an exception to the log file and store and return a new RuntimeException that wraps around the exception. |
|
static java.lang.String |
fixedLength(java.lang.String s,
int length)
Log a debug message to the log file and the store if the subsystem's flag is set. |
|
static boolean |
flag(Log.Tag.Sys t)
Check if a subsystem will print debug message to the LOG file |
|
static java.lang.String |
getLogDir()
|
|
static java.lang.String |
getLogPathFileName()
|
|
static void |
info(Log.Tag.Sys t,
java.lang.Object... objects)
Log an information message to standard out, the log file and the store. |
|
static void |
info(java.lang.Object... objects)
Log an information message to standard out, the log file and the store. |
|
static void |
log(java.io.File file,
java.io.PrintStream stream)
|
|
static void |
main(java.lang.String[] args)
|
|
static java.lang.String |
padRight(java.lang.String stringToPad,
int size)
|
|
static void |
POST(int n,
java.lang.Exception e)
|
|
static void |
POST(int n,
java.lang.String s)
POST stands for "Power on self test". |
|
static void |
setFlag(Log.Tag.Sys t)
Set the debug flag. |
|
static void |
unsetFlag(Log.Tag.Sys t)
Unset the debug flag. |
|
static java.io.PrintStream |
unwrap(java.io.PrintStream stream)
|
|
static void |
unwrap(java.io.PrintStream stream,
java.lang.String s)
Print a message to the stream without the logging information. |
|
static java.lang.Throwable |
warn(Log.Tag.Sys t,
java.lang.String msg)
Log a warning to standard out, the log file and the store. |
|
static
|
warn(Log.Tag.Sys t,
java.lang.String msg,
T exception)
Log a warning to standard out, the log file and the store. |
|
static java.lang.Throwable |
warn(java.lang.String msg)
Log a warning to standard out, the log file and the store. |
|
static void |
wrap()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final Log.Tag.Kind[] KINDS
public static final Log.Tag.Sys[] SYSS
public static final Key LOG_KEY
public static final long PID
public static boolean _dontDie
Constructor Detail |
---|
public Log()
Method Detail |
---|
public static void wrap()
public static boolean flag(Log.Tag.Sys t)
public static void setFlag(Log.Tag.Sys t)
public static void unsetFlag(Log.Tag.Sys t)
public static java.lang.String getLogDir()
public static java.lang.String getLogPathFileName()
public static <T extends java.lang.Throwable> T err(Log.Tag.Sys t, java.lang.String msg, T exception)
public static void err(Log.Tag.Sys t, java.lang.String msg)
public static <T extends java.lang.Throwable> T err(java.lang.String msg, T exception)
public static void err(java.lang.String msg)
public static <T extends java.lang.Throwable> T err(Log.Tag.Sys t, T exception)
public static <T extends java.lang.Throwable> T err(T exception)
public static java.lang.RuntimeException errRTExcept(java.lang.Throwable exception)
public static <T extends java.lang.Throwable> T warn(Log.Tag.Sys t, java.lang.String msg, T exception)
public static java.lang.Throwable warn(Log.Tag.Sys t, java.lang.String msg)
public static java.lang.Throwable warn(java.lang.String msg)
public static void info(Log.Tag.Sys t, java.lang.Object... objects)
public static void info(java.lang.Object... objects)
public static void debug(java.lang.Object... objects)
public static void debug(Log.Tag.Sys t, java.lang.Object... objects)
public static java.lang.String fixedLength(java.lang.String s, int length)
public static java.lang.String padRight(java.lang.String stringToPad, int size)
public static void die(java.lang.String s)
public static void unwrap(java.io.PrintStream stream, java.lang.String s)
public static java.io.PrintStream unwrap(java.io.PrintStream stream)
public static void log(java.io.File file, java.io.PrintStream stream) throws java.lang.Exception
java.lang.Exception
public static void POST(int n, java.lang.String s)
n
- POST code.s
- String to emit.public static void POST(int n, java.lang.Exception e)
public static void main(java.lang.String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |