Ejemplo n.º 1
0
 public void log_a_debug_event_containing(string message, params object[] args)
 {
     if (_verbose)
     {
         _logger.WriteMessage(string.Format(message, args));
     }
 }
Ejemplo n.º 2
0
        public void WriteResultFile(XmlNode resultNode, string outputPath)
        {
            if (resultNode.Attributes == null)
            {
                return;
            }

            var num  = 0;
            var stat =
                from attr in resultNode.Attributes.Cast <XmlAttribute>()
                where !StringComparer.InvariantCultureIgnoreCase.Equals(attr.Name, "id")
                where int.TryParse(attr.Value, out num)
                select new { name = attr.Name, val = num };

            foreach (var item in stat)
            {
                TeamCityWriter.WriteMessage($"{item.name}: {item.val}");
            }
        }
            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.º 4
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());
            }
        }