This commit is contained in:
hns 2003-01-28 12:38:29 +00:00
parent 712cba2d99
commit 585db17d22
3 changed files with 18 additions and 11 deletions

View file

@ -62,7 +62,7 @@ public class ResponseBean implements Serializable {
res.writeBinary (what); res.writeBinary (what);
} }
public void debug (String message) { public void debug (Object message) {
res.debug (message); res.debug (message);
} }

View file

@ -237,10 +237,13 @@ public final class ResponseTrans implements Externalizable {
* that buffer exists and its length is larger than offset. str may be null, in which * that buffer exists and its length is larger than offset. str may be null, in which
* case nothing happens. * case nothing happens.
*/ */
public void debug (String str) { public void debug (Object message) {
if (debugBuffer == null) if (debugBuffer == null)
debugBuffer = new StringBuffer (); debugBuffer = new StringBuffer ();
debugBuffer.append ("<p><span style=\"background: yellow; color: black\">"+str+"</span></p>"); String str = message == null ? "null" : message.toString ();
debugBuffer.append ("<p><span style=\"background: yellow; color: black\">");
debugBuffer.append (str);
debugBuffer.append ("</span></p>");
} }
/** /**

View file

@ -24,23 +24,27 @@ public class ApplicationBean implements Serializable {
app.clearCache (); app.clearCache ();
} }
public void log (String msg) { public void log (Object msg) {
app.logEvent (msg); String str = msg == null ? "null" : msg.toString();
app.logEvent (str);
} }
public void log (String logname, String msg) { public void log (String logname, Object msg) {
app.getLogger (logname).log (msg); String str = msg == null ? "null" : msg.toString();
app.getLogger (logname).log (str);
} }
public void debug (String msg) { public void debug (Object msg) {
if (app.debug()) { if (app.debug()) {
app.logEvent (msg); String str = msg == null ? "null" : msg.toString();
app.logEvent (str);
} }
} }
public void debug (String logname, String msg) { public void debug (String logname, Object msg) {
if (app.debug()) { if (app.debug()) {
app.getLogger (logname).log (msg); String str = msg == null ? "null" : msg.toString();
app.getLogger (logname).log (str);
} }
} }