|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |
java.lang.Objectjava.lang.Enum<Log>
utils.Log
public enum Log
Common application message logger facility (static implementation)
Nested Class Summary | |
---|---|
static interface |
Log.AttentionContext
|
Enum Constant Summary | |
---|---|
ALL
Log all messages |
|
ATTN
Log attn messages |
|
AUDIO
Log audio messages |
|
DEBUG
Log debug messages |
|
ERROR
Log errors |
|
INFO
Log information |
|
PDU
Log binary PDUs |
|
TRACE
Log program trace |
|
WARN
Log warnings |
|
VERB
Log verbose PDUs |
Field Summary | |
---|---|
static Log.AttentionContext |
attn
Instance of the interface for attention messages |
private java.lang.String |
desc
Log channel description |
static java.io.PrintStream |
err
Print stream for error messages |
private int |
mask
Log channel bitmap |
static java.io.PrintStream |
out
Print stream for standard messages |
private static Log |
showChannels
Current channels to be logged. |
Method Summary | |
---|---|
static void |
attn(java.lang.String string)
Logs a attention message. |
static void |
audio(java.lang.String string)
Logs a audio message. |
static void |
debug(java.lang.String string)
Logs a debug message. |
static void |
error(java.lang.String string)
Logs a warning message. |
static java.lang.String |
EscapeHTML(java.lang.String str)
Escapes HTML reserved characters (as we are logging HTML tagged messages) It also replaces form-feed characters with HTML line-breaks. |
static void |
exception(Log channel,
java.lang.Exception ex)
Returns current callee's name of the method, file, location and description of the exception. |
static void |
info(java.lang.String string)
Logs a informational message. |
static boolean |
isEnabled(Log channel)
Returns if log channel is enabled |
static java.lang.String |
now()
Gets current time stamp -- date and time in ISO format |
static java.lang.String |
nowDate()
Gets current time stamp -- date only |
static java.lang.String |
nowMillis()
Gets current time stamp -- time with milliseconds |
static java.lang.String |
nowTime()
Gets current time stamp -- time only |
static void |
pdu(java.lang.String string)
Logs a protocol data unit |
private static void |
println(Log channel,
java.lang.String message)
Logs message with prefix and time-stamp |
static void |
setEnabled(Log channel,
boolean on)
Enables/disables the Log channel |
static java.lang.String |
toHex(byte[] array)
Converts a byte array into a hex string. |
static java.lang.String |
toHex(byte[] array,
int length,
java.lang.String separator)
Converts a byte array into a hex string, using the specified separator. |
static java.lang.String |
toHex(byte[] array,
java.lang.String separator)
Converts a byte array into a hex string, using the specified separator. |
static void |
trace(java.lang.String string)
Logs a program trace message. |
static Log |
valueOf(java.lang.String name)
Returns the enum constant of this type with the specified name. |
static Log[] |
values()
Returns an array containing the constants of this enum type, in the order they are declared. |
static void |
warn(java.lang.String string)
Logs a warning message. |
static void |
verb(java.lang.String string)
Logs a verbose message. |
static void |
where()
Prints where this message was called from, via a stack trace. |
Methods inherited from class java.lang.Enum |
---|
clone, compareTo, equals, finalize, getDeclaringClass, hashCode, name, ordinal, toString, valueOf |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Enum Constant Detail |
---|
public static final Log ALL
public static final Log AUDIO
public static final Log VERB
public static final Log PDU
public static final Log DEBUG
public static final Log ATTN
public static final Log TRACE
public static final Log INFO
public static final Log WARN
public static final Log ERROR
Field Detail |
---|
private int mask
private java.lang.String desc
private static Log showChannels
public static java.io.PrintStream out
public static java.io.PrintStream err
public static Log.AttentionContext attn
Method Detail |
---|
public static Log[] values()
for (Log c : Log.values()) System.out.println(c);
public static Log valueOf(java.lang.String name)
name
- the name of the enum constant to be returned.
java.lang.IllegalArgumentException
- if this enum type has no constant
with the specified name
java.lang.NullPointerException
- if the argument is nullpublic static void setEnabled(Log channel, boolean on)
public static boolean isEnabled(Log channel)
private static void println(Log channel, java.lang.String message)
public static void error(java.lang.String string)
public static void warn(java.lang.String string)
public static void info(java.lang.String string)
public static void debug(java.lang.String string)
public static void attn(java.lang.String string)
public static void trace(java.lang.String string)
public static void pdu(java.lang.String string)
public static void verb(java.lang.String string)
public static void audio(java.lang.String string)
public static void where()
public static void exception(Log channel, java.lang.Exception ex)
public static java.lang.String toHex(byte[] array, int length, java.lang.String separator)
array
- The byte arraylength
- The length to printseparator
- The separator (may be null)
public static java.lang.String toHex(byte[] array, java.lang.String separator)
public static java.lang.String toHex(byte[] array)
public static java.lang.String nowDate()
public static java.lang.String nowTime()
public static java.lang.String now()
public static java.lang.String nowMillis()
public static java.lang.String EscapeHTML(java.lang.String str)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | ENUM CONSTANTS | FIELD | METHOD | DETAIL: ENUM CONSTANTS | FIELD | METHOD |