|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--swpchat.util.Diag
A class that prints diagnostic (debugging or error) messages in an informative, flexible and dynamic way.
Method names are rather short as they shouldn't take up too much space in the client source code.
Field Summary | |
static java.lang.String |
CLS
The fully qualified class name. |
private static java.lang.String |
DefaultDiagFileName
The default name of the configurations file, it is used if the System Property PKDiagFileName is not set. |
private static DiagLog |
diagLog
|
private static java.lang.String |
diagLogFileName
|
private static DiagProps |
diagProps
|
static int |
EXHIBITIONIST
Details that will hardly ever be of interest, except in voodo debugging circumstances. |
private static java.util.GregorianCalendar |
gregorianCalendar
|
static int |
INTERNAL_ERROR
Internal problems that just may get fixed. |
static int |
PACKAGE_ENTRY_EXIT
Entry and exit of package visible methods (without modifier). |
private static java.lang.String |
PKDiagFileName
The name of the property that stores the configurations file. |
static int |
PRIVATE_ENTRY_EXIT
Entry and exit of private methods. |
static int |
PROTECTED_ENTRY_EXIT
Entry and exit of protected methods. |
static int |
PUBLIC_ENTRY_EXIT
Entry and exit of publically visible methods. |
private static boolean |
showdbgmessages
|
static int |
STRANGE
Close to a warning, things that should not happen: Exceptions that are definitively not expected, unreachable default clauses etc. |
static int |
TALKATIVE
Begins to strain the reader, talks also about things working just as expected. |
static int |
VERBOSE
Things that just *might* be of interest, such as major control structures. |
private static boolean |
writeinlog
|
Constructor Summary | |
private |
Diag()
A Private constructor to prevent instantiation. |
Method Summary | |
static void |
blink(java.lang.String message,
java.lang.String location,
int level)
Print an extremely short message, no line of its own. |
static void |
dbg(java.lang.String message,
java.lang.String location,
int level)
Print the debugging message, if debugging is enabled for the function, class, or some ancestor package at the appropriate level. |
static void |
debugMessagesOff()
Stop issuing debug messages alltogether. |
static void |
debugMessagesOn()
Issue debug messages as specified by the location and level. |
static void |
err(java.lang.String message,
java.lang.String location)
Print an error message. |
private static java.lang.String |
getConfigFileName(java.lang.String fileName,
java.lang.String defaultFileName)
get the path of the config file with the given name |
static void |
msg(java.lang.String message)
Print the log message. |
static void |
notImplemented(java.lang.String location)
Issue a message that this method is not implemented yet. |
static void |
reload()
Reloads the properties. |
static void |
setConfigFileName(java.lang.String configFileName)
saves the config file name in PKDiagFileName |
static void |
writeDebugMessagesOff()
Stop writeing debug messages in log-file |
static void |
writeDebugMessagesOn()
Writeing debug messages in log-file as specified by the location and level. |
Methods inherited from class java.lang.Object |
|
Field Detail |
private static java.lang.String PKDiagFileName
private static java.lang.String DefaultDiagFileName
private static DiagProps diagProps
private static java.lang.String diagLogFileName
private static DiagLog diagLog
private static java.util.GregorianCalendar gregorianCalendar
private static boolean showdbgmessages
private static boolean writeinlog
public static int STRANGE
public static int INTERNAL_ERROR
public static int PUBLIC_ENTRY_EXIT
public static int PACKAGE_ENTRY_EXIT
public static int VERBOSE
public static int PROTECTED_ENTRY_EXIT
public static int TALKATIVE
public static int PRIVATE_ENTRY_EXIT
public static int EXHIBITIONIST
public static final java.lang.String CLS
Constructor Detail |
private Diag()
Method Detail |
public static void msg(java.lang.String message)
message
- The message to show to the user.public static void dbg(java.lang.String message, java.lang.String location, int level)
message
- The message to show to the user.location
- The location of the call in the code. This is
also written to the log.
This is a string containing the complete methodname followed
by paramter types in paranthesis,
e. g. "util.Diag.dbg(String,String,int)
". The
most specific entry in the internal database is matched
against this string. The example is matched by:
util.Diag.dbg(String,String,int)
,
util.Diag.dbg
, util.Diag
,
util
and, if none of the others is found, the
root entry. util.Diag.dbg()
does
not match the example.
level
- The level of this message. The message is shown
iff the debuglevel defined for the most specific location
entry is equal to or larger than this value. Expect a message
with a level of 0 to be printed always. (Although someone
could define a negative level for a location)public static void blink(java.lang.String message, java.lang.String location, int level)
message
- The message to show to the user.location
- The location of the call in the code. This is
a string containing the complete methodname followed by
parameter types in paranthesis,
e. g. "util.Diag.dbg(String,String,int)
". The
most specific entry in the internal database is matched
against this string. The example is matched by:
util.Diag.dbg(String,String,int)
,
util.Diag.dbg
, util.Diag
,
util
and, if none of the others is found, the
root entry. util.Diag.dbg()
does
not match the example.level
- The level of this message. The message is shown
iff the debuglevel defined for the most specific location
entry is equal to or larger than this value. Expect a message
with a level of 0 to be printed always. (Although someone
could define a negative level for a location)public static void err(java.lang.String message, java.lang.String location)
message
- The message to show to the user.location
- Where did the error occur. This is a string
containing the complete methodname followed by paramter types
in paranthesis, e. g. "util.Diag.dbg(String,String,
int)
".public static void notImplemented(java.lang.String location)
location
- This is a string containing the complete
methodname followed by paramter types in paranthesis,
e. g. "util.Diag.dbg(String,String,int),
".public static void debugMessagesOff()
public static void debugMessagesOn()
public static void writeDebugMessagesOff()
public static void writeDebugMessagesOn()
public static void reload()
private static java.lang.String getConfigFileName(java.lang.String fileName, java.lang.String defaultFileName)
String
- fileNameString
- defaultFileNamepublic static void setConfigFileName(java.lang.String configFileName)
configFileName
- the String
specifying the
name of the config file, that is just the
filename without directory.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |