修复LOG提交异常

This commit is contained in:
liu.wenjie
2021-12-18 13:20:47 +08:00
parent f72cca2331
commit a4db2f0ff2
10 changed files with 2557 additions and 0 deletions

View File

@@ -0,0 +1,41 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace Logger
{
public partial class LogDetail : Form
{
string logMsg = string.Empty;
public LogDetail(string inputMsg)
{
InitializeComponent();
logMsg = inputMsg;
}
private void LogDetail_Load(object sender, EventArgs e)
{
try
{
string time = Regex.Split(logMsg, " -> ")[0];
string msgLevel = Regex.Split(logMsg, " -> ")[1].Split(',')[0];
string msgDetal = Regex.Split(logMsg, " -> ")[1];
txbLogTime.Text = time;
txbLogLevel.Text = msgLevel;
txbLogLevel.BackColor = (msgLevel == "Warn" || msgLevel == "Exception") ? Color.Red : Color.Lime;
richDetail.Text = msgDetal;
}
catch (Exception)
{
richDetail.Text = logMsg;
}
}
}
}