Пример #1
0
        /// <summary>
        /// Log an error message to the build tracking participant.
        /// </summary>
        /// <param name="context">The current activity context.</param>
        /// <param name="message">The message to log.</param>
        private void LogBuildError(NativeActivityContext context, string message)
        {
            var record = new BuildInformationRecord <BuildError>
            {
                ParentToBuildDetail = false,
                Value = new BuildError
                {
                    Message = message
                }
            };

            context.Track(record);
        }
Пример #2
0
        private void LogMessage(BuildMessageImportance logLevel, CodeActivityContext context, string message)
        {
            BuildInformationRecord <BuildMessage> record =
                new BuildInformationRecord <BuildMessage>()
            {
                Value = new BuildMessage()
                {
                    Importance = logLevel,
                    Message    = message,
                },
            };

            context.Track(record);
        }
Пример #3
0
        /// <summary>
        /// Log a message to the build tracking participant.
        /// </summary>
        /// <param name="context">The current activity context.</param>
        /// <param name="message">The message to log.</param>
        /// <param name="importance">The importance level of the message.</param>
        private void LogBuildMessage(NativeActivityContext context, string message, BuildMessageImportance importance)
        {
            var record = new BuildInformationRecord <BuildMessage>
            {
                ParentToBuildDetail = false,
                Value = new BuildMessage
                {
                    Importance = importance,
                    Message    = message
                }
            };

            context.Track(record);
        }
        public static void Log(this CodeActivityContext context, string format, params object[] parameters)
        {
            var message = string.Format(format, parameters);

            var record = new BuildInformationRecord<BuildMessage>
            {
                Value = new BuildMessage
                {
                    Importance = BuildMessageImportance.High,
                    Message = message
                }
            };

            context.Track(record);
        }
        /// <summary>
        /// Messages are logged to build log if the user instructed us to log (through the VerboseLogging argument) or if an error occured
        /// </summary>
        private void LogMessage(String message, CodeActivityContext context, bool isError = false)
        {
            bool shouldLog = context.GetValue(this.VerboseLogging);
            if (shouldLog || isError)
            {
                BuildInformationRecord<BuildMessage> record =
                  new BuildInformationRecord<BuildMessage>()
                  {
                      Value = new BuildMessage()
                      {
                          Importance = BuildMessageImportance.High,
                          Message = message,
                      },
                  };

                context.Track(record);
            }
        }
 /// <summary>
 /// Log a message to the build tracking participant.
 /// </summary>
 /// <param name="context">The current activity context.</param>
 /// <param name="message">The message to log.</param>
 /// <param name="importance">The importance level of the message.</param>
 private static void LogBuildMessage(NativeActivityContext context, string message, BuildMessageImportance importance)
 {
     var record = new BuildInformationRecord<BuildMessage>
     {
         ParentToBuildDetail = false,
         Value = new BuildMessage
         {
             Importance = importance,
             Message = message
         }
     };
     context.Track(record);
 }
 /// <summary>
 /// Log an error message to the build tracking participant.
 /// </summary>
 /// <param name="context">The current activity context.</param>
 /// <param name="message">The message to log.</param>
 private static void LogBuildError(NativeActivityContext context, string message)
 {
     var record = new BuildInformationRecord<BuildError>
     {
         ParentToBuildDetail = false,
         Value = new BuildError
         {
             Message = message
         }
     };
     context.Track(record);
 }