Esempio n. 1
0
 public LogMessageViewModel(LogMessage logMessage)
 {
     TimeStamp = logMessage.TimeStamp.ToString("HH:mm:ss.fff");
     LoggerName = logMessage.LoggerName;
     if (LoggerName.Length > 60)
     {
         LoggerName = LoggerName.Substring(60, LoggerName.Length - 60);
     }
     Level = logMessage.Level;
     LevelCssClass = GetLevelCssClass(logMessage.Level);
     MessageShort = logMessage.Message.Substring(0, Math.Min(logMessage.Message.Length, 130));
     MessageFull = logMessage.Message;
     Exception = logMessage.ExceptionString;
 }
Esempio n. 2
0
 public static void BroadcastLogMessage(LogMessage logMessage)
 {
     var hub = GetHubContext();
     hub.Clients["log"].newLogMessage(new LogMessageViewModel(logMessage));
 }