コード例 #1
0
        private void ProcessItemMessage(string message, string[] data)
        {
            if (data.Length % 2 != 0)
            {
                log.Errors.Add($"Test logger error: unexpected value for captured item data message: {message}. Expecting a four part message: CAPTURE{CapturedDataSeparator}ITEM{CapturedDataSeparator}[Name]{CapturedDataSeparator}[Value]");
                return;
            }

            var itemData = new BuildItem
            {
                Name     = data[2],
                Value    = data[3],
                Metadata = new List <BuildKeyValue>()
            };

            log.CapturedItemValues.Add(itemData);

            // Process any metadata items
            for (var i = 4; i < data.Length; i = i + 2)
            {
                var metadataItem = new BuildKeyValue
                {
                    Name  = data[i],
                    Value = data[i + 1]
                };
                itemData.Metadata.Add(metadataItem);
            }
        }
コード例 #2
0
        private void ProcessPropertyMessage(string message, string[] data)
        {
            if (data.Length != 4)
            {
                log.Errors.Add($"Test logger error: unexpected value for captured property data message: {message}. Expecting a four part message: CAPTURE{CapturedDataSeparator}PROPERTY{CapturedDataSeparator}[Name]{CapturedDataSeparator}[Value]");
                return;
            }

            var capturedData = new BuildKeyValue
            {
                Name  = data[2],
                Value = data[3]
            };

            log.CapturedProperties.Add(capturedData);
        }