Пример #1
0
        public static string AssembleTexStringFromPartsStructure(MessageParts mp)
        {
            string result;

            if (mp.SecondaryMessage.Length > 0)
            {
                result = "{[" + mp.MachineName + "][" + mp.ProcessId + "][" + mp.osThreadId + "][" + mp.netThreadId + "][" + mp.ModuleName + "][" + mp.lineNumber + "][" + mp.AdditionalLocationData + "]}" + mp.MessageType + mp.DebugMessage + Constants.SECONDARYSTRINGSEPARATOR + mp.SecondaryMessage;
            }
            else
            {
                result = "{[" + mp.MachineName + "][" + mp.ProcessId + "][" + mp.osThreadId + "][" + mp.netThreadId + "][" + mp.ModuleName + "][" + mp.lineNumber + "][" + mp.AdditionalLocationData + "]}" + mp.MessageType + mp.DebugMessage;
            }
            return(result);
        }
Пример #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);
        }