public void Write([NotNull] string message, MessageState messageState)
            {
                if (message == null)
                {
                    throw new ArgumentNullException(nameof(message));
                }
                switch (messageState)
                {
                case MessageState.Warning:
                    _writer.WriteWarning(message);
                    break;

                case MessageState.Error:
                    _writer.WriteError(message);
                    break;

                default:
                    _writer.WriteMessage(message);
                    break;
                }
            }
Ejemplo n.º 2
0
        /// <summary>
        /// Called when a test message is received.
        /// </summary>
        private void TestMessageHandler(object sender, TestRunMessageEventArgs e)
        {
            try
            {
                switch (e.Level)
                {
                case TestMessageLevel.Informational:
                    _teamCityWriter.WriteMessage(e.Message);
                    break;

                case TestMessageLevel.Warning:
                    _teamCityWriter.WriteWarning(e.Message);
                    break;

                case TestMessageLevel.Error:
                    _teamCityWriter.WriteError(e.Message);
                    break;
                }
            }
            catch (Exception ex)
            {
                _teamCityWriter.WriteError("TeamCity Logger Error", ex.ToString());
            }
        }
Ejemplo n.º 3
0
 public void log_a_warning_event_containing(string message, params object[] args)
 {
     _logger.WriteWarning(string.Format(message, args));
 }