public static void DevLog <T>(this ManualLogSource log, T[] array, Func <T, string> transform, [CallerMemberName] string message = null) { log.LogInfo(message); log.LogInfo(typeof(T).FullName + "[" + array.Length.ToString() + "]:"); for (int i = 0; i < array.Length; ++i) { log.LogInfo(" " + transform(array[i])); } log.LogInfo(""); }
public static void MeasureEnd(this ManualLogSource log, long token, [CallerMemberName] string ctx = null) { long elapsed = Stopwatch.GetTimestamp() - token; double scale = (double)Stopwatch.Frequency / TimeSpan.TicksPerSecond; log.LogInfo(ctx + " end: " + TimeSpan.FromTicks((long)(elapsed / scale)).ToString()); }
static void LogPatchSegment(ManualLogSource log, MethodBase original, ReadOnlyCollection <Patch> patches, string header) { if (patches.Count == 0) { return; } log.LogInfo(header); for (int i = 0; i < patches.Count; ++i) { Patch patch = patches[i]; log.DevLog(patch.GetMethod(original).FullDescription()); log.DevLog(string.Format("[{0}] {1} {2}", patch.owner, patch.index.ToString(), patch.priority.ToString())); } }
public static void MeasureStart(this ManualLogSource log, ref long token, [CallerMemberName] string ctx = null) { token = Stopwatch.GetTimestamp(); log.LogInfo(ctx + " start:"); }
public static void DevLog(this ManualLogSource log, [CallerMemberName] string message = null) { log.LogInfo(message); }