Put that new method somewhere more sensible.

git-svn-id: https://samskivert.googlecode.com/svn/trunk@2440 6335cc39-0255-0410-8fd6-9bcaacd3b74c
This commit is contained in:
samskivert
2008-09-22 16:57:48 +00:00
parent 12292b89f2
commit 52fa489fe5
+27 -27
View File
@@ -39,33 +39,6 @@ package com.samskivert.util;
*/
public abstract class Logger
{
/**
* Formats the given message and array of alternating key value pairs like so:
*
* <pre>message [key=value, key=value, key=value]</pre>
*/
public static String format (Object message, Object... args)
{
StringBuilder buf = new StringBuilder();
buf.append(message);
if (args != null && args.length > 1) {
buf.append(" [");
for (int ii = 0, nn = args.length/2; ii < nn; ii++) {
if (ii > 0) {
buf.append(", ");
}
buf.append(args[2*ii]).append("=");
try {
StringUtil.toString(buf, args[2*ii+1]);
} catch (Throwable t) {
buf.append("<toString() failure: " + t + ">");
}
}
buf.append("]");
}
return buf.toString();
}
/**
* Used to create logger instances. This is only public so that the log factory can be
* configured programmatically via {@link Logger#setFactory}.
@@ -105,6 +78,33 @@ public abstract class Logger
_factory.init();
}
/**
* Formats the given message and array of alternating key value pairs like so:
*
* <pre>message [key=value, key=value, key=value]</pre>
*/
public static String format (Object message, Object... args)
{
StringBuilder buf = new StringBuilder();
buf.append(message);
if (args != null && args.length > 1) {
buf.append(" [");
for (int ii = 0, nn = args.length/2; ii < nn; ii++) {
if (ii > 0) {
buf.append(", ");
}
buf.append(args[2*ii]).append("=");
try {
StringUtil.toString(buf, args[2*ii+1]);
} catch (Throwable t) {
buf.append("<toString() failure: " + t + ">");
}
}
buf.append("]");
}
return buf.toString();
}
/**
* Logs a debug message.
*