|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--swpchat.util.DiagProps
Class uses Properties to store, save and load debuglevels to certain keys .
Field Summary | |
static java.lang.String |
CLS
The Name of the current class for debugging output. |
private static java.lang.String |
defaultLogFileName
default log filename. |
private java.util.Properties |
defaults
|
private java.lang.String |
diagFileName
|
private static java.lang.String |
PKDiagLogFileName
The property key for log-file filename. |
private java.lang.String |
STR_DIAG
|
private java.lang.String |
STR_LEVEL
|
Constructor Summary | |
DiagProps(java.lang.String diagFileName)
Constructor for DiagProps. |
Method Summary | |
int |
getDebuglevel(java.lang.String pkMethodName)
Returns the default debuglevel of the method specified in pkMethodName. |
java.lang.String |
getLogFileName()
returns the specified DiagLogFileName. |
void |
reload()
Load the new Properties if the name of the config file changed during runtime. |
protected void |
save()
store default properties in diagFileName |
void |
setConfigFileName(java.lang.String diagFileName)
set the name of the Properties file |
void |
setGlobalDebuglevel(int debuglevel)
Sets the global debublevel. |
void |
setMethodDebuglevel(java.lang.String pkMethodName,
int debuglevel)
Sets the default debuglevel for the method (or class, package) pkMethodName. |
private java.util.Vector |
tokenize(java.lang.String pkMethodName)
Creates the Property keys that could possibly match to pkMethodName and returns them in a Vector . |
Methods inherited from class java.lang.Object |
|
Field Detail |
private static final java.lang.String PKDiagLogFileName
private static final java.lang.String defaultLogFileName
private java.util.Properties defaults
private java.lang.String diagFileName
private final java.lang.String STR_DIAG
private final java.lang.String STR_LEVEL
public static final java.lang.String CLS
Constructor Detail |
public DiagProps(java.lang.String diagFileName)
pkDiagFileName
- String
specifying
the complete name of the sourcefile
of the Properties.Method Detail |
public void setConfigFileName(java.lang.String diagFileName)
diagFileName
- String
specifying the new
filenamepublic void reload()
private java.util.Vector tokenize(java.lang.String pkMethodName) throws ParserException
Vector
. That is for example, if the given key is
"util.Diag.dbg(String,String,int)
"
than elementAt(1) is "Diag.util.debuglevel
",
elementAt(2) is "Diag.util.Diag.debuglevel
",
elementAt(3) is "Diag.util.Diag.dbg.debuglevel
",
elementAt(4) is "Diag.util.Diag.dbg(String,String,int).debuglevel
",
elementAt(0) is always "Diag.debuglevel
", which is the
global debuglevel which is valid, if no other key matches to an
existing Property.pkMethodName
- String
specifying the complete
name of the method whose debuglevel is asked for,
i.e. with with Package and class name.public int getDebuglevel(java.lang.String pkMethodName)
pkMethodName
- String
specifying the complete
name of the method whose debuglevel is asked for,
i.e. with with Package and class name.public void setMethodDebuglevel(java.lang.String pkMethodName, int debuglevel)
pkMethodName
- String
specifying the complete
name of the method whose debuglevel is asked for,
i.e. with with Package and class name.debuglevel
- the new debuglevelpublic void setGlobalDebuglevel(int debuglevel)
debuglevel
- the new global debuglevelprotected void save()
public java.lang.String getLogFileName()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |