public static void Add(TraceMessage trm) { if (traceMessageList.Count >= DecisionServiceTrace.MaxTraceCount) { traceMessageList.Clear(); DecisionServiceTrace.Add(new TraceMessage { Message = string.Format("Max # trace messages received : {0}, resetting.", DecisionServiceTrace.MaxTraceCount) }); } string lowerCaseMessage = trm.Message.ToLower(); if (lowerCaseMessage.Contains("model update") || lowerCaseMessage.Contains("successfully uploaded") || lowerCaseMessage.Contains("retrieved new model")) { trm.Message = TraceMessage.GetHeader(TraceMessage.TraceComponentType.Client) + trm.Message; } traceMessageList.Add(trm); IHubContext hub = GlobalHost.ConnectionManager.GetHubContext <TraceHub>(); hub.Clients.All.addNewMessageToPage(trm.Message, trm.TimeStampInMillisecSinceUnixEpoch); }
public override void WriteLine(string message) { DecisionServiceTrace.Add(new TraceMessage { Message = message }); }