private void Log(SharedObject.enOutputType type, string msg) { Task.Run(async delegate() { if (msg.Length > 150) { msg = msg.Substring(0, 150); } //await ViewModelLocator.Instance.Main.ControlServerService.Log(this.Name, this.Version, type.ToString(), msg); }); }
private void Log(SharedObject.enOutputType type, string msg) { Task.Run(async() => { //记录活动日志到服务器 const int limit = 150; if (msg.Length > limit) { msg = msg.Substring(0, limit); } await ViewModelLocator.Instance.Main.ControlServerService.Log(Name, Version, type.ToString(), msg);//有可能有中文,截短点以便数据库字段能存的上 }); }
public void Log(SharedObject.enOutputType type, string msg, string msgDetails) { //如果消息详情为空,则默认详情复用消息的内容 if (string.IsNullOrEmpty(msgDetails)) { msgDetails = msg; } var item = new OutputListItem(); switch (type) { case SharedObject.enOutputType.Error: item.IsError = true; ErrorCount++; item.TextForeground = "#e91530"; break; case SharedObject.enOutputType.Information: item.IsInformation = true; InformationCount++; item.TextForeground = "Black"; break; case SharedObject.enOutputType.Warning: item.IsWarning = true; WarningCount++; item.TextForeground = "#f59f36"; break; case SharedObject.enOutputType.Trace: item.IsTrace = true; TraceCount++; item.TextForeground = "#696969"; break; default: break; } item.IsShowTimestamps = IsShowTimestamps; item.Timestamps = DateTime.Now.ToString("MM/dd/yyyy HH:mm:ss"); item.Msg = msg; item.MsgDetails = msgDetails; OutputItems.Add(item); doSearch(); }
private void LogToOutputWindow(SharedObject.enOutputType type, string msg, string msgDetails) { Log(type, msg); //活动日志:type={0},msg={1},msgDetails={2} Logger.Debug(string.Format(ResxIF.GetString("ActivityLog"), type, msg, msgDetails), logger); }
private void LogToOutputWindow(SharedObject.enOutputType type, string msg, string msgDetails) { Librarys.Logger.Info(string.Format("活动日志:type={0},msg={1},msgDetails={2}", type.ToString(), msg, msgDetails)); }
public LogMessageActivity() { Level = SharedObject.enOutputType.Information; }