Example #1
0
        public static void WriteFlowMarker(FlowMarker position, TraceLevel level)
        {
            StackTrace st       = new StackTrace();
            StackFrame sf       = st.GetFrame(1);
            MethodBase method   = sf.GetMethod();
            var        fullName = string.Format("{0}.{1}({2})", method.ReflectedType.FullName, method.Name, string.Join(",", method.GetParameters().Select(o => string.Format("{0} {1}", o.ParameterType, o.Name)).ToArray()));

            WriteLineIf(position.ToString() + "::" + fullName, level);
            //WriteLineIf(position.ToString() + "::" + currentMethod.ReflectedType.Name + "::" + currentMethod.Name, TraceLevel.Info);
        }
Example #2
0
        public static void WriteFlowMarker(FlowMarker position)
        {
            if (position == FlowMarker.ExitMethod)
            {
                if (logIndentation.Length >= logIndentationMarker.Length)
                {
                    logIndentation = logIndentation.Substring(logIndentationMarker.Length);
                }
            }
            StackTrace st       = new StackTrace();
            StackFrame sf       = st.GetFrame(1);
            MethodBase method   = sf.GetMethod();
            var        fullName = string.Format("{0}.{1}({2})", method.ReflectedType.FullName, method.Name, string.Join(",", method.GetParameters().Select(o => string.Format("{0} {1}", o.ParameterType, o.Name)).ToArray()));

            WriteLineIf(position.ToString() + "::" + fullName, TraceLevel.Info);
            if (position == FlowMarker.EnterMethod)
            {
                logIndentation += logIndentationMarker;
            }
            //WriteLineIf(position.ToString() + "::" + currentMethod.ReflectedType.Name + "::" + currentMethod.Name, TraceLevel.Info);
        }