Esempio n. 1
0
 public void Trace(clsTrace.trcType trcTraceType, string Format, object[] ParmArray, trcOption TraceOption)
 {
     if ((mSupport != null) && (mSupport.Trace != null))
     {
         mSupport.Trace.Trace(trcTraceType, string.Format(Format, ParmArray), TraceOption);
     }
 }
Esempio n. 2
0
 public void Trace(clsTrace.trcType trcTraceType, string Message, trcOption TraceOption)
 {
     if ((mSupport != null) && (mSupport.Trace != null))
     {
         mSupport.Trace.Trace(trcTraceType, Message, TraceOption);
     }
 }
Esempio n. 3
0
 public void Trace(clsTrace.trcType trcTraceType, string Format, object Arg1, object Arg2, object Arg3, trcOption TraceOption)
 {
     if ((mSupport != null) && (mSupport.Trace != null))
     {
         mSupport.Trace.Trace(trcTraceType, string.Format(Format, Arg1, Arg2, Arg3), TraceOption);
     }
 }
        public void Trace(clsTrace.trcType trcTraceType, string Message, clsTrace.trcOption trcTraceOptions = trcOption.trcNone, System.Diagnostics.Process ceProcess = null)
        {
            string TraceFile = bpeNullString;

            lock (TraceLock) {
                //Override Trace Parameters if trcAll...
                if (trcTraceOptions == trcOption.trcAll && !fTraceMode)
                {
                    TraceFile = mSupport.LogFile;
                }
                else
                {
                    if (!fTraceMode || trcTraceOptions == 0)
                    {
                        return;
                    }
                    if (((mTraceOptions & trcTraceOptions) == 0))
                    {
                        return;
                    }
                    TraceFile = mTraceFile;
                }

                mThreadID = System.Threading.Thread.CurrentThread.ManagedThreadId;
                //Debug.WriteLine("Trace Options: " & CType(trcTraceOptions, trcOption).ToString)

                //Make sure we allocate a new TraceIndent for this ThreadID...
                clsIndentByThread objIBT = null;
                objIBT = ThreadIndents[Convert.ToString(mThreadID)];
                if (trcTraceType == trcType.trcExit && objIBT.TraceIndent > 0)
                {
                    objIBT.TraceIndent -= 1;
                }
                switch (trcTraceType)
                {
                case trcType.trcEnter:
                    Message = "Entering " + Message;
                    break;

                case trcType.trcExit:
                    Message = "Exiting " + Message;
                    break;
                }

                if ((mTraceOptions & trcOption.trcMemory) == trcOption.trcMemory)
                {
                    long TotalMemory = GC.GetTotalMemory(false);
                    Message += MemoryStats(TotalMemory, Process.GetCurrentProcess());
                    switch (trcTraceType)
                    {
                    case trcType.trcExit:
                        if ((ceProcess != null))
                        {
                            Message += MemoryConsumed(TotalMemory, ceProcess, Process.GetCurrentProcess());
                        }
                        break;
                    }
                }
                this.LogMessage(TraceFile, Message, objIBT.TraceIndent, false);

                if (trcTraceType == trcType.trcEnter)
                {
                    objIBT.TraceIndent += 1;
                }
            }
        }