static public void Debug (int category, string message, params object[] args)
{
if ((category & DebugFlags) == 0)
return;
StringBuilder sb = new StringBuilder (message);
if ((args != null) && (args.Length > 0)) {
sb.Append (": ");
bool first = true;
foreach (object arg in args) {
if (first)
first = false;
else
sb.Append (", ");
if (arg == null)
sb.Append ("null");
// else if (arg is ICollection)
// sb.Append (PrintCollection ((ICollection) arg));
else
sb.Append (arg);
}
}
Console.WriteLine (sb.ToString ());
}
/*