protected override void HandleNodeMessage(LogMessageForNode logMessage)
        {
            if (UseTestCoordinator)
            {
                var nodeMessage = new MultiNodeLogMessage(logMessage.When.Ticks, logMessage.Message,
                logMessage.NodeIndex, logMessage.LogSource, logMessage.Level);

                TestCoordinatorActorRef.Tell(nodeMessage);
            }
        }
        protected override void HandleNodeMessage(LogMessageForNode logMessage)
        {
            if (UseTestCoordinator)
            {
                var nodeMessage = new MultiNodeLogMessage(logMessage.When.Ticks, logMessage.Message,
                                                          logMessage.NodeIndex, logMessage.LogSource, logMessage.Level);

                TestCoordinatorActorRef.Tell(nodeMessage);
            }
        }
Пример #3
0
        public static bool TryParseLogMessage(string messageStr, out LogMessageForNode logMessage)
        {
            var matchLog = NodeLogMessageRegex.Match(messageStr);

            if (!matchLog.Success)
            {
                logMessage = null;
                return(false);
            }

            LogLevel logLevel;

            Enum.TryParse(matchLog.Groups["level"].Value, true, out logLevel);

            var logSource = matchLog.Groups["logsource"].Value;
            var message   = matchLog.Groups["message"].Value;
            var nodeIndex = Int32.Parse(matchLog.Groups["node"].Value);

            logMessage = new LogMessageForNode(nodeIndex, message, logLevel, DateTime.UtcNow, logSource);

            return(true);
        }
 private void WriteNodeMessage(LogMessageForNode nodeMessage)
 {
     Console.ForegroundColor = ColorForLogLevel(nodeMessage.Level);
     Console.WriteLine(nodeMessage.ToString());
     Console.ResetColor();
 }
        protected override void HandleNodeMessage(LogMessageForNode logMessage)
        {
            WriteNodeMessage(logMessage);

            base.HandleNodeMessage(logMessage);
        }
 private void WriteNodeMessage(LogMessageForNode nodeMessage)
 {
     Console.ForegroundColor = ColorForLogLevel(nodeMessage.Level);
     Console.WriteLine(nodeMessage.ToString());
     Console.ResetColor();
 }
        protected override void HandleNodeMessage(LogMessageForNode logMessage)
        {
            WriteNodeMessage(logMessage);

            base.HandleNodeMessage(logMessage);
        }
Пример #8
0
        public static bool TryParseLogMessage(string messageStr, out LogMessageForNode logMessage)
        {
            var matchLog = NodeLogMessageRegex.Match(messageStr);
            if (!matchLog.Success)
            {
                logMessage = null;
                return false;
            }
            
            LogLevel logLevel;
            Enum.TryParse(matchLog.Groups["level"].Value, true, out logLevel);

            var logSource = matchLog.Groups["logsource"].Value;
            var message = matchLog.Groups["message"].Value;
            var nodeIndex = Int32.Parse(matchLog.Groups["node"].Value);
            logMessage = new LogMessageForNode(nodeIndex, message, logLevel, DateTime.UtcNow, logSource);

            return true;
        }
Пример #9
0
 protected abstract void HandleNodeMessage(LogMessageForNode logMessage);
Пример #10
0
 protected abstract void HandleNodeMessage(LogMessageForNode logMessage);