Пример #1
0
        /// <summary>
        /// InternalTime checkpoint method handles timer start and stop requests
        /// </summary>
        /// <param name="timerTitle">The instance timer to be used</param>
        /// <param name="timerSinkCategory">A generic category to total time for</param>
        /// <param name="timerStart">Is this a start or stop timer</param>
        internal void InternalTimeCheckpoint(MessageMetadata mmd, string timerTitle, string timerSinkCategory, bool timerStart)
        {
            // while this likes a duplicate it allows for other functions within Tex to call time skink

            DateTime timeCheck = DateTime.Now;

            if (timerSinkCategory == null)
            {
                timerSinkCategory = string.Empty;
            }

            string timerDataString = TraceMessageFormat.AssembleTimerContentString(timerTitle, timerSinkCategory, timeCheck);
            string timerEnterExit; //= timerStart ?  :

            if (timerStart)
            {
                mmd.CommandType = TraceCommandTypes.SectionStart;
                timerEnterExit  = " Passed ";
            }
            else
            {
                mmd.CommandType = TraceCommandTypes.SectionEnd;
                timerEnterExit  = " Exited ";
            }
            mmd.Body           = String.Format(Constants.TIMER_SECTIONIDENTIFIER + "Time Checkpoint " + timerTitle + timerEnterExit + ". Time Entered {0,2}", timeCheck.ToString());
            mmd.FurtherDetails = timerDataString;
            ActiveRouteMessage(mmd);
        }
Пример #2
0
        protected override string ActualConvert(MessageMetadata msg)
        {
            string       result;
            MessageParts nextMsg = new MessageParts();

            msg.NullsToEmptyStrings();
            // These will cause the stream to be written if we are queueingf messages.
            //if ((messageType == Constants.ASSERTIONFAILED) || (theMessage == Constants.EXCEPTIONENDTAG) || (messageType == Constants.ERRORMSG)) {
            //    nextMsg.TriggerRefresh = true;
            //}
            Emergency.Diags.Log("Formatting string");
            try {
                nextMsg.DebugMessage     = msg.Body;
                nextMsg.SecondaryMessage = msg.FurtherDetails;
                nextMsg.ClassName        = msg.ClassName;
                nextMsg.lineNumber       = msg.LineNumber;
                nextMsg.MethodName       = msg.MethodName;
                nextMsg.MachineName      = msg.MachineName;
                nextMsg.netThreadId      = msg.NetThreadId;
                nextMsg.osThreadId       = msg.OSThreadId;
                nextMsg.ProcessId        = msg.ProcessId;
                //nextMsg.ModuleName = Path.GetFileNameWithoutExtension(msg.FileName);
                nextMsg.ModuleName             = msg.FileName;
                nextMsg.AdditionalLocationData = msg.ClassName + "::" + msg.MethodName;

                // Populate Message Type
                nextMsg.MessageType = TraceCommands.TraceCommandToString(msg.CommandType);

                result = TraceMessageFormat.AssembleTexStringFromPartsStructure(nextMsg);
            } catch (Exception ex) {
                Emergency.Diags.Log("EXX >> " + ex.Message);
                throw;
            }
            Emergency.Diags.Log("REturning legacvy string" + result);
            return(result);
        }