예제 #1
0
 /// <summary>
 /// Interpret a wcc_lite command output string
 /// </summary>
 /// <param name="sflag"></param>
 /// <param name="cmdName"></param>
 /// <param name="value"></param>
 private void InterpretLogMessage(SystemLogFlag sflag, ToolFlag tool, string cmdName, string value)
 {
     if (tool == ToolFlag.TLF_Radish)
     {
         var data = new RADLogMessage
         {
             SystemFlag  = sflag,
             CommandName = cmdName,
             Tool        = tool
         };
         InterpretRADMessage(ref data, value);
         if (data.Flag != LogFlag.WLF_Info)
         {
             ExtendedLog.Add(data);
         }
     }
     else
     {
         var data = new WCCLogMessage
         {
             SystemFlag  = sflag,
             CommandName = cmdName,
             Tool        = tool
         };
         InterpretWCCMessage(ref data, value);
         if (data.Flag != LogFlag.WLF_Info)
         {
             ExtendedLog.Add(data);
         }
     }
 }
예제 #2
0
        private void InterpretWCCMessage(ref WCCLogMessage data, string value)
        {
            try
            {
                // read timestamp
                int    flagEnd   = value.IndexOf(']');
                string timestamp = value?.Substring(1, flagEnd - 1);
                value          = value?.Remove(0, flagEnd + 1);
                data.Timestamp = timestamp;

                // read WccFlag
                flagEnd = value.IndexOf(']');
                string wflag = value?.Substring(1, flagEnd - 1);
                value     = value?.Remove(0, flagEnd + 1);
                data.Flag = GetWFlagFromString(wflag);

                // read Module
                flagEnd = value.IndexOf(']');
                string module = value?.Substring(1, flagEnd - 1);
                value          = value?.Remove(0, flagEnd + 1);
                data.WccModule = module;

                // read LogMessage
                string message = value?.Substring(1);
                data.Value = message;
            }
            catch (Exception)
            {
                data.Flag      = LogFlag.WLF_Info;
                data.WccModule = "Verbose";
                data.Value     = value;
                //ExtendedLog.Add(data);
            }
        }