public static void _DLOG_List(this string format, IEnumerable list, params object[] args) { if (list != null) { foreach (var item in list) { if (args != null && args.Length > 0) { object[] newargs = new object[args.Length + 1]; Array.Copy(args, 0, newargs, 1, args.Length); newargs[0] = item.ToString(); Tools._writeDebugDiagnosticMessage(Tools.FormatStr(format, newargs), true, true, 2, 1); } else { Tools._writeDebugDiagnosticMessage(Tools.FormatStr(format, item.ToString()), true, true, 2, 1); } } } else { if (args != null && args.Length > 0) { object[] newargs = new object[args.Length + 1]; Array.Copy(args, 0, newargs, 1, args.Length); newargs[0] = "NULL"; Tools._writeDebugDiagnosticMessage(Tools.FormatStr(format, newargs), true, true, 2, 1); } else { Tools._writeDebugDiagnosticMessage(Tools.FormatStr(format, "NULL"), true, true, 2, 1); } } }
public static void _DLOG(this string format, params object[] args) { string text = null; try { text = Tools.FormatStr(format, args); } catch (ArgumentNullException) { text = "-- -- --"; } catch (FormatException) { text = "-- -- --"; } try { Tools._writeDebugDiagnosticMessage(text, true, true, 3, 4); } catch (Exception ex) { throw new ApplicationException("Unhandled:" + ex.Message); } }