|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.mozilla.util.Log
public class Log
Logging facility.
Field Summary | |
---|---|
static java.lang.String |
LOG
|
static java.lang.String |
LOG_STRINGS
|
static java.util.logging.Logger |
LOGGER
|
Constructor Summary | |
---|---|
Log()
|
Method Summary | |
---|---|
protected static java.lang.Object |
applicationNameWithTimeStamp()
|
static void |
enableTimestampPrefix(boolean enable)
Incrememnts or decrements whether or not to prefix logged messages with a timestamp. |
static java.lang.String |
getApplicationName()
Returns the applicationName set by "setApplicationName()" |
static java.lang.String |
getApplicationVersion()
Returns the applicationVersion set by "setApplicationVersion()" |
static java.lang.String |
getApplicationVersionDate()
Returns the applicationVersion set by "setApplicationVersionDate()" |
static java.util.logging.Logger |
getLogger(java.lang.String loggerName)
|
static void |
log(java.lang.Object infoMessage)
Writes "infoMessage" to stdout, prefixed by the string "ApplicationName: " |
static void |
logDebugMessage(java.lang.Object debugMessage)
Equivalent to calling "logDebugMessage(debugMessage, "ALL")". |
static void |
logDebugMessage(java.lang.Object debugMessage,
boolean aCondition)
Log a message when "aCondition" is true, otherwise be silent. |
static void |
logDebugMessage(java.lang.Object anInstance,
java.lang.Object debugMessage)
Equivalent to calling "logDebugMessage(anInstance, debugMessage, "ALL")". |
static void |
logDebugMessage(java.lang.Object anInstance,
java.lang.Object debugMessage,
boolean aCondition)
Log a message when "aCondition" is true, otherwise be silent. |
static void |
logDebugMessage(java.lang.Object anInstance,
java.lang.Object debugMessage,
java.lang.String debugFilter)
Writes "debugMessage" to stderr, prefixed by the string "ApplicationName: ClassName[0xhashCode]: " * |
static void |
logDebugMessage(java.lang.Object debugMessage,
java.lang.String debugFilter)
Funnel-point method for printing debug messages. |
static void |
logError(java.lang.Object errorMessage)
Writes "errorMessage" to stderr, prefixed by the string "ApplicationName error: " |
static void |
logErrorMessage(java.lang.Object errorMessage)
Writes "errorMessage" to stderr, prefixed by the string "ApplicationName: " |
static void |
setApplicationName(java.lang.String newApplicationName)
This string will be prepended to all output from this class. |
static void |
setApplicationVersion(java.lang.String newApplicationVersion)
|
static void |
setApplicationVersionDate(java.lang.String newApplicationVersionDate)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String LOG_STRINGS
public static final java.lang.String LOG
public static final java.util.logging.Logger LOGGER
Constructor Detail |
---|
public Log()
Method Detail |
---|
public static java.util.logging.Logger getLogger(java.lang.String loggerName)
public static void setApplicationName(java.lang.String newApplicationName)
This string will be prepended to all output from this class.
This string is usually the application name, e.g. "JavaPlan".
It is useful because it includes a timestamp and the base string (usually the application name), so that if two apps are launched from the same commandline (for example), with "&", or one app invokes another, it is clear who the message is comming from. The time stamp can help see how long operations took, etc.
If you don't want your messages prefixed with anything (no time stamp or name), you must pass "null" for "applicationName".
If this method is never called, "applicationName" will default to: "APPLICATION NAME UNKNOWN [call setApplicationName from main]"
public static java.lang.String getApplicationName()
public static void setApplicationVersion(java.lang.String newApplicationVersion)
public static java.lang.String getApplicationVersion()
public static void setApplicationVersionDate(java.lang.String newApplicationVersionDate)
public static java.lang.String getApplicationVersionDate()
protected static java.lang.Object applicationNameWithTimeStamp()
public static void enableTimestampPrefix(boolean enable)
public static void log(java.lang.Object infoMessage)
public static void logError(java.lang.Object errorMessage)
public static void logErrorMessage(java.lang.Object errorMessage)
public static void logDebugMessage(java.lang.Object debugMessage, java.lang.String debugFilter)
Funnel-point method for printing debug messages.
Writes "debugMessage" to stderr, prefixed by the string "ApplicationName:"
This method only works if the debugFilter string is found in Debug's list of filter strings (which you can normally set on the commandline, see JDApplication), or if the "ALL" filter has been set into Debug's list of filters, or if the passed in filter is "", which is considered to always be "set", and will print a line with "[DEBUG]" listed as the filter.
This method may be called with a "null" debugMessage. A debugMessage is sometimes unneccesary since the matched filter string is printed with the output anyway, and that is frequently enough information.
public static void logDebugMessage(java.lang.Object debugMessage)
public static void logDebugMessage(java.lang.Object debugMessage, boolean aCondition)
public static void logDebugMessage(java.lang.Object anInstance, java.lang.Object debugMessage, boolean aCondition)
public static void logDebugMessage(java.lang.Object anInstance, java.lang.Object debugMessage)
public static void logDebugMessage(java.lang.Object anInstance, java.lang.Object debugMessage, java.lang.String debugFilter)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |