public static ProcessRun.OutData ParseLog(ProcessRun.OutData inputData) { MatchCollection mCol = Regex.Matches(inputData.Message, @"^(\w+):\s(.+)$"); if (mCol.Count > 0) { switch (mCol[0].Groups[1].Value) { case "W": return(new OutData(StreamType.Warning, inputData.Time, mCol[0].Groups[2].Value)); case "Warning": return(new OutData(StreamType.Warning, inputData.Time, mCol[0].Groups[2].Value)); case "I": return(new OutData(StreamType.Info, inputData.Time, mCol[0].Groups[2].Value)); default: return(inputData); } } else { return(inputData); } }
private void ToLog(ProcessRun.OutData outData) { ProcessRun.OutData result = APKTool.ParseLog(outData); switch (result.Stream) { case ProcessRun.StreamType.Info: ToLog(result.Time.ToString("[dd.MM.yyyy HH:mm:ss]"), result.Message, Properties.Resources.info, Color.FromKnownColor(KnownColor.Window)); ToStatus(result.Message, Properties.Resources.info); break; case ProcessRun.StreamType.Error: ToLog(result.Time.ToString("[dd.MM.yyyy HH:mm:ss]"), result.Message, Properties.Resources.error, Color.FromKnownColor(KnownColor.LightPink)); ToStatus(result.Message, Properties.Resources.error); break; case ProcessRun.StreamType.Warning: ToLog(result.Time.ToString("[dd.MM.yyyy HH:mm:ss]"), result.Message, Properties.Resources.warning, Color.FromKnownColor(KnownColor.LightYellow)); ToStatus(result.Message, Properties.Resources.warning); break; default: break; } }
private void processRun_ErrorDataReceived(object sender, ProcessRun.OutData e) { ToLog(e); }
private void _apktool_ErrorDataReceived(object sender, ProcessRun.OutData e) { //ToLog(e.Message); ToLog(e); }