Ejemplo n.º 1
0
 /// <summary>
 /// Formats the debug message and writes it to the build log.
 /// </summary>
 /// <param name="currentInstance">The current Task instance which is performing the log.</param>
 /// <param name="format">The format string.</param>
 /// <param name="arguments">The format string arguments.</param>
 public static void LogDebug(Element currentInstance, string format, params object[] arguments)
 {
   string logMessage = string.Format(CultureInfo.CurrentCulture, format, arguments);
   currentInstance.Log(Level.Debug, logMessage);
 }
Ejemplo n.º 2
0
    /// <summary>
    /// Formats the error message and writes it to the build log.
    /// If the build threads aren't executed at the moment, a <see cref="BuildException" /> will be thrown.
    /// </summary>
    /// <param name="currentInstance">The current Task instance which is performing the log.</param>
    /// <param name="innerException">The inner exception.</param>
    /// <param name="format">The format string.</param>
    /// <param name="arguments">The format string arguments.</param>
    public static void LogError(Element currentInstance, Exception innerException, string format, params object[] arguments)
    {
      string logMessage = string.Format(CultureInfo.CurrentCulture, format, arguments);
      currentInstance.Log(Level.Error, logMessage);
      lock (LastExceptionLock)
      {
        BuildException buildException = new BuildException(logMessage, innerException);
        if (buildThreadsActive == false)
        {
          throw buildException;
        }

        if (lastException == null)
        {
          lastException = buildException;
        }
      }
    }