// ReSharper disable once RedundantAssignment private static void InitializeUnpackerTrace(Unpacker unpacker, ref UnpackerTraceContext context, #if TRACING [CallerMemberName] #endif // TRACING string callerMemberName = null ) { #if TRACING long positionOrOffset; unpacker.GetPreviousPosition(out positionOrOffset); context = new UnpackerTraceContext(positionOrOffset, callerMemberName); #endif // TRACING }
private static void Trace(UnpackerTraceContext context, string label, Unpacker unpacker) { #if TRACING long positionOrOffset; unpacker.GetPreviousPosition(out positionOrOffset); TraceCore( "{0}.{1}::{2:#,0}->{3:#,0}", context.MethodName, label, context.PositionOrOffset, positionOrOffset ); context.PositionOrOffset = positionOrOffset; #endif // TRACING }
private static void Trace(UnpackerTraceContext context, string label, Unpacker unpacker, int index, IList <string> itemNames) { #if TRACING long positionOrOffset; unpacker.GetPreviousPosition(out positionOrOffset); TraceCore( "{0}.{1}[{4}]@{5}::{2:#,0}->{3:#,0}", context.MethodName, label, context.PositionOrOffset, positionOrOffset, itemNames[index], index ); context.PositionOrOffset = positionOrOffset; #endif // TRACING }