Methods Summary |
---|
private int | calcSeverityLevel(java.lang.String original)
if(original == null || original.length() <= 0)
return DISABLED;
String s = original.toUpperCase();
// first let's see if it is an integer...
try
{
int ret = Integer.parseInt(s);
if(ret < 0)
ret = 0;
return ret;
}
catch(NumberFormatException e)
{
}
// not a number -- let's check a few more possibilities...
if(s.equals("ALL") || s.equals("NOISY") || s.equals("EVERYTHING") || s.equals("ON") //NOI18N
|| s.equals("MONDO") || s.equals("YES") || s.equals("TRUE") || s.equals("DUMP") || s.startsWith("MAX"))//NOI18N
return 0;
if(s.startsWith("NO") || s.equals("OFF") || s.equals("FALSE") || s.equals("QUIET") || s.startsWith("MIN"))//NOI18N
return DISABLED;
// it should be "WARN", "CRITICAL", etc.
// since all of the values start with a different character,
// just check the first character...
char first = s.charAt(0); // uppercase!!
for(int i = 0; i < severityNames.length; i++)
{
if(severityNames[i].toUpperCase().charAt(0) == first)
return i;
}
// I give up!
debug("Unknown value for commandline argument \"-DIABDebug=" + original + "\"");//NOI18N
return DISABLED;
|
private boolean | checkSeverity(int severity)
if(severity >= severityLevel)
return true;
return false;
|
public void | crit(java.lang.Object o)
if(checkSeverity(CRIT))
pr(CRITICAL, o);
|
public void | critical(java.lang.Object o)
if(checkSeverity(CRIT))
pr(CRITICAL, o);
|
private void | ctor(java.lang.String theName, int theSeverityLevel)
if(theName != null && theName.length() > 0)
setName(theName);
if(theSeverityLevel >= 0)
setSeverityLevel(theSeverityLevel);
else
{
String sl = System.getProperty("ForteReporterDebugLevel");//NOI18N
if(sl != null && sl.length() > 0)
{
//int sli = Integer.parseInt(sl);
//setSeverityLevel(sli);
setSeverityLevel(sl);
}
sl = System.getProperty("com.iplanet.util.diagnostic.Reporter.severityLevel");//NOI18N
if(sl != null && sl.length() > 0)
{
//int sli = Integer.parseInt(sl);
//setSeverityLevel(sli);
setSeverityLevel(sl);
}
sl = System.getProperty("com.sun.enterprise.util.diagnostic.Reporter.severityLevel");//NOI18N
if(sl != null && sl.length() > 0)
{
//int sli = Integer.parseInt(sl);
//setSeverityLevel(sli);
setSeverityLevel(sl);
}
sl = System.getProperty("Reporter");//NOI18N
if(sl != null && sl.length() > 0)
{
//int sli = Integer.parseInt(sl);
//setSeverityLevel(sli);
setSeverityLevel(sl);
}
}
className = getClass().getName();
writer = new ReporterWriter(getName());
debug("Ctor called");//NOI18N
debug("ReporterImpl Severity Level: " + getSeverityLevel());//NOI18N
|
private void | debug(java.lang.String s)
if(doDebug)
//Bug 4677074 System.out.println("ReporterImpl Report --> " + s);//NOI18N
//Bug 4677074 begin
_logger.log(Level.FINE,"ReporterImpl Report --> " +s);
//Bug 4677074 end
|
public void | dump(java.lang.Object o, java.lang.String s)
if(checkSeverity(DUMP) && o != null)
{
if(s == null)
s = "";
String s2 = s + "\n********** Object Dump Start ***********\n" +//NOI18N
ObjectAnalyzer.toStringWithSuper(o) + "\n********** Object Dump End ***********";//NOI18N
pr(OBJECT_DUMP, s2);
}
|
public void | dump(java.lang.String s)
if(checkSeverity(DUMP))
{
pr(OBJECT_DUMP, s);
}
|
public void | dump(java.lang.Object o)
dump(o, null);
|
public void | error(java.lang.Object o)
if(checkSeverity(ERROR))
pr(ERROR, o);
|
private CallerInfo | getCallerInfo()
try
{
return new CallerInfo(new Object[] { this });
}
catch(CallerInfoException e)
{
debug(e.toString());
return null;
}
|
private java.lang.String | getClassName()
Assertion.check(className);
return className;
|
public java.lang.String | getName()
return name;
|
public int | getSeverityLevel()
return severityLevel;
|
public java.lang.String | getSeverityLevelString()
if(severityLevel <= OFF)
return severityNames[severityLevel];
return severityNames[OFF];
|
public void | info(java.lang.Object o)
if(checkSeverity(INFO))
pr(INFO, o);
|
public void | insist(java.lang.String s)
if(checkSeverity(ASSERT))
{
try
{
Assertion.check(s);
}
catch(Assertion.Failure f)
{
pr(ASSERT, new StackTrace().toString() + f);
throw f;
}
}
|
public void | insist(java.lang.String checkme, java.lang.String s)
if(checkSeverity(ASSERT))
{
try
{
Assertion.check(checkme, s);
}
catch(Assertion.Failure f)
{
pr(ASSERT, new StackTrace().toString() + f);
throw f;
}
}
|
public void | insist(boolean b)
if(checkSeverity(ASSERT))
{
try
{
Assertion.check(b);
}
catch(Assertion.Failure f)
{
pr(ASSERT, new StackTrace().toString() + f);
throw f;
}
}
|
public void | insist(boolean b, java.lang.String s)
if(checkSeverity(ASSERT))
{
try
{
Assertion.check(b, s);
}
catch(Assertion.Failure f)
{
pr(ASSERT, new StackTrace().toString() + f);
throw f;
}
}
|
public void | insist(java.lang.Object o)
if(checkSeverity(ASSERT))
{
try
{
Assertion.check(o);
}
catch(Assertion.Failure f)
{
pr(ASSERT, new StackTrace().toString() + f);
throw f;
}
}
|
public void | insist(java.lang.Object o, java.lang.String s)
if(checkSeverity(ASSERT))
{
try
{
Assertion.check(o, s);
}
catch(Assertion.Failure f)
{
pr(ASSERT, new StackTrace().toString() + f);
throw f;
}
}
|
public void | insist(double z)
if(checkSeverity(ASSERT))
{
try
{
Assertion.check(z);
}
catch(Assertion.Failure f)
{
pr(ASSERT, new StackTrace().toString() + f);
throw f;
}
}
|
public void | insist(double z, java.lang.String s)
if(checkSeverity(ASSERT))
{
try
{
Assertion.check(z, s);
}
catch(Assertion.Failure f)
{
pr(ASSERT, new StackTrace().toString() + f);
throw f;
}
}
|
public void | insist(long l)
if(checkSeverity(ASSERT))
{
try
{
Assertion.check(l);
}
catch(Assertion.Failure f)
{
pr(ASSERT, new StackTrace().toString() + f);
throw f;
}
}
|
public void | insist(long l, java.lang.String s)
if(checkSeverity(ASSERT))
{
try
{
Assertion.check(l, s);
}
catch(Assertion.Failure f)
{
pr(ASSERT, new StackTrace().toString() + f);
throw f;
}
}
|
private void | pr(int severity, java.lang.Object o)
try
{
CallerInfo ci = getCallerInfo();
String s;
if(o == null)
{
s = "null Object argument";//NOI18N
}
else
{
s = o.toString();
if(s == null) // || s.length() <= 0)
s = "null toString result from Object";//NOI18N
}
if(ci != null)
s = ci.toString() + ": " + s;//NOI18N
writer.println(severity, s);
}
catch(Throwable e)
{
//Bug 4677074 System.out.println("Got exception in ReporterImpl.pr(): " + e);//NOI18N
//Bug 4677074 begin
_logger.log(Level.WARNING,"iplanet_util.pr_exception",e);
//Bug 4677074 end
}
|
public void | setName(java.lang.String theName)
Assertion.check(theName);
name = theName;
|
public void | setSeverityLevel(int level)
debug("setSeverityLevel(" + level + ")");//NOI18N
if(level < 0)
level = 0;
severityLevel = level;
|
public void | setSeverityLevel(java.lang.String level)
debug("setSeverityLevel(" + level + ")");//NOI18N
severityLevel = calcSeverityLevel(level);
|
public ReporterWriter | setWriter(ReporterWriter lwriter)Change the mechanism this object uses to deliver output to the user
ReporterWriter retVal = null;
if (null != lwriter) {
retVal = this.writer;
this.writer = lwriter;
}
return retVal;
|
public void | verbose(java.lang.Object o)
if(checkSeverity(VERBOSE))
pr(VERBOSE, o);
|
public void | warn(java.lang.Object o)
// convenience method
if(checkSeverity(WARN))
pr(WARNING, o);
|
public void | warning(java.lang.Object o)
if(checkSeverity(WARN))
pr(WARNING, o);
|