示例#1
0
 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("");
 }
示例#2
0
        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());
        }
示例#3
0
        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()));
            }
        }
示例#4
0
 public static void MeasureStart(this ManualLogSource log, ref long token, [CallerMemberName] string ctx = null)
 {
     token = Stopwatch.GetTimestamp();
     log.LogInfo(ctx + " start:");
 }
示例#5
0
 public static void DevLog(this ManualLogSource log, [CallerMemberName] string message = null)
 {
     log.LogInfo(message);
 }