anchor.diff:  type TraceMode =
   | Console
   | Xml
  +
  +type Message = 
  +    { Text      : string
  +      Color     : ConsoleColor
  +      Newline   : bool
  +      Important : bool}
  +
  +let private defaultMessage = 
  +    { Text      = ""
  +      Color     = ConsoleColor.White
  +      Newline   = true
  +      Important = false }
  +
  +/// Logs the specified string to the console
  +let private logMessageToConsole important newLine s =     
  +    if important && buildServer <> CCNet then
  +        if newLine then
  +            eprintfn "%s" (toRelativePath s)
  +        else 
  +            eprintf "%s" (toRelativePath s)
  +    else
  +        if newLine then
  +            printfn "%s" (toRelativePath s)
  +        else 
  +            printf "%s" (toRelativePath s)
  +
  +let private appendXML line = AppendToFile xmlOutputFile [line]
   
   /// The actual trace mode.
   let mutable traceMode = 
       match buildServer with
       | TeamCity   -> Console
       | CCNet      -> Xml
  -    | LocalBuild -> Console
  -    
  -let appendXML line = AppendToFile xmlOutputFile [line]
  -
  -let mutable openTags = []
  +    | LocalBuild -> Console    
   
   /// Trace verbose output
   let mutable verbose = hasBuildParam "verbose"
  
positive.code: 
  /// Traces an error (in red)
  let traceError error = 
    match traceMode with
    | Console -> logColored true ConsoleColor.Red true error
    | Xml     ->  
       appendXML "<failure><builderror>"
       xmlMessage error
       appendXML "</builderror></failure>"
    
  
  /// Traces the EnvironmentVariables
  let TraceEnvironmentVariables() = 
    [ EnvironTarget.Machine; 
      EnvironTarget.Process;
      EnvironTarget.User]
      |> List.iter (fun mode ->    
          traceFAKE "Environment-Settings (%A):" mode
          environVars mode |> List.iter (tracefn "  %A"))        
   
  /// Gets the FAKE Version string
  let fakeVersionStr = 
      fakeVersion.ToString()
        |> sprintf "FAKE - F# Make - Version %s" 
  
  /// Traces the begin of the build
  let traceStartBuild _ =
    match traceMode with
    | Console -> ()
    | Xml     ->         
        let fi = new FileInfo(xmlOutputFile)
        if fi.Exists then
          fi.IsReadOnly <- false
          fi.Delete()
        if not fi.Directory.Exists then fi.Directory.Create()
          
        appendXML "<buildresults>"
  
  /// Traces the end of the build
  let traceEndBuild _=
    match traceMode with
    | Console -> ()
    | Xml     -> appendXML "</buildresults>"
  
  let openTag tag =  openTags <- tag :: openTags
  
  let closeTag tag =
    match openTags with
    | x::rest when x = tag -> openTags <- rest
    | _ -> failwith "Invalid Tag-structure"
    appendXML <| sprintf "</%s>" tag
    
  let closeAllOpenTags() = openTags |> Seq.iter closeTag
  
  /// Traces the begin of a target
  let traceStartTarget name dependencyString =
    match traceMode with
    | Console -> 
        tracefn "Starting Target: %s %s" name dependencyString
    | Xml     -> 
        openTag "target"
        appendXML <| sprintf "<target name=\"%s\">" name
        xmlMessage dependencyString
  
    ReportProgressStart <| sprintf "Target: %s" name
     
  /// Traces the end of a target   
  let traceEndTarget name =
    match traceMode with
    | Console -> tracefn "Finished Target: %s" name
    | Xml     -> closeTag "target"
    ReportProgressFinish <| sprintf "Target: %s" name       
    
    
  /// Traces the begin of a task
  let traceStartTask task description =
    match traceMode with
    | Console -> ()
    | Xml     -> 
      openTag "task"
      appendXML <| sprintf "<task name=\"%s\">" task
    ReportProgressStart <| sprintf "Task: %s %s" task description
     
  /// Traces the end of a task
  let traceEndTask task  description =
    match traceMode with
    | Console -> ()
    | Xml     -> closeTag "task" 
    ReportProgressFinish <| sprintf "Task: %s %s" task description       
negative.code: let fakePath = productName.GetType().Assembly.Location
         
  /// Gets the FAKE version no.
  let fakeVersion = productName.GetType().Assembly.GetName().Version
  
  let private buffer = MailboxProcessor.Start (fun inbox ->
      let rec loop () = 
          async {
              let! (msg:Message) = inbox.Receive()
              match traceMode with
              | Console ->
                  let curColor = Console.ForegroundColor
                  Console.ForegroundColor <- msg.Color
                  logMessageToConsole msg.Important msg.Newline msg.Text
                  Console.ForegroundColor <- curColor
              | Xml     -> appendXML msg.Text
  
              return! loop ()}
  
      loop ())
      
  let mutable private openTags = []
  
  /// Writes a XML message to the bufffer.
  let xmlMessage message =
      { defaultMessage with Text = sprintf "<message level=\"Info\"><![CDATA[%s]]></message>" message }
        |> buffer.Post 
      
  /// Logs the specified string (via message buffer)
  let logMessage important newLine message =
      match traceMode with
      | Console ->
          { Text = message; Important = important; Newline = newLine; Color = ConsoleColor.White }
            |> buffer.Post
      | Xml     -> xmlMessage message
  
  /// Logs the specified string        
  