Tracers/Tracer.cs
/// <summary>
/// Use this to trace a local resource (like a method or some action).
/// </summary>
Use this to trace a local resource (like a method or some action).
Use this to trace a local resource ( like a method or some action ) .
public static T TraceLocal<T>(string operationName, Func<T> function)
        {
            var tracer = new LocalOperationTracer();
            try
            {
                tracer.BeginTrace(operationName);
                return function.Invoke();
            }
            catch (Exception exception)
            {
                TracerContext.AddTag("Exception", exception.Message);
                TracerContext.AddTag("StackTrace", exception.StackTrace);
            }
            finally
            {
                tracer.EndTrace();
            }
            return default;
        }
public static T TraceLocal < T > ( string operationName , Func < T > function ) { var tracer = new LocalOperationTracer ( ) ; try { tracer . BeginTrace ( operationName ) ; return function . Invoke ( ) ; } catch ( Exception exception ) { TracerContext . AddTag ( " " , exception . Message ) ; TracerContext . AddTag ( " " , exception . StackTrace ) ; } finally { tracer . EndTrace ( ) ; } return default ; }
Use this to trace a local resource (like a method or some action).
Use this to trace a local resource ( like a method or some action ) .
operationName
string
function
Func<T>