Пример #1
0
        /// <summary>
        /// Exits the method.
        /// </summary>
        static public void ExitMethod()
        {
            TraceThreadInfo threadInfo = RequestObjectManager.GetRequestObject();

            threadInfo.Pop();
            if (threadInfo.EndOfStack())
            {
                RequestObjectManager.RemoveRequest();
            }
        }
Пример #2
0
        /// <summary>
        /// Enters the method.
        /// </summary>
        /// <param name="tracer">The tracer.</param>
        /// <returns></returns>
        static public TraceThreadInfo EnterMethod(IRITrace tracer)
        {
            TraceThreadInfo threadInfo = RequestObjectManager.GetRequestObject(out bool bNew);

            if (bNew)
            {
                // must be first calling thread (parent)
                threadInfo.RootTracer = tracer;
            }

            threadInfo.Push(tracer);

            return(threadInfo);
        }
Пример #3
0
        /// <summary>
        /// Gets the active tracer.
        /// </summary>
        /// <returns></returns>
        static public IRITrace GetActiveTracer()
        {
            IRITrace tracer;

            TraceThreadInfo threadInfo = RequestObjectManager.GetRequestObject();

            if (threadInfo != null)
            {
                tracer = threadInfo.Peek();
            }
            else
            {
                tracer = null;
            }

            return(tracer ?? Default);
        }