anchor.diff:      | FinishedMessage    -> ConsoleColor.White
       | _                  -> ConsoleColor.Gray
   
  -/// <summary>Implements a TraceListener for System.Console</summary>
  -/// <param name="importantMessagesToStdErr">Defines whether to trace important messages to StdErr.</param>
  -/// <param name="colorMap">A function which maps TracePriorities to ConsoleColors.</param>
  +/// Implements a TraceListener for System.Console
  +/// ## Parameters
  +///  - `importantMessagesToStdErr` - Defines whether to trace important messages to StdErr.
  +///  - `colorMap` - A function which maps TracePriorities to ConsoleColors.
   type ConsoleTraceListener(importantMessagesToStdErr,colorMap) =
       let writeText toStdErr color newLine text =
           let curColor = Console.ForegroundColor
  
positive.code: ﻿[<AutoOpen>]
  module Fake.TraceListener
  
  open System
  
  /// Defines Tracing information for TraceListeners
  type TraceData =
      | StartMessage
      | ImportantMessage of string
      | ErrorMessage  of string
      | LogMessage of string * bool
      | TraceMessage of string * bool
      | FinishedMessage 
      | OpenTag of string * string
      | CloseTag of string
  
  /// Defines a TraceListener interface
  type ITraceListener =
      abstract Write: TraceData -> unit
  
  /// Maps TracePriorities to ConsoleColors
  let colorMap = function
      | ImportantMessage _ -> ConsoleColor.Yellow
      | ErrorMessage _     -> ConsoleColor.Red
      | LogMessage _       -> ConsoleColor.Gray
  
negative.code:             xmlWriter.Flush()
              if AutoCloseXmlWriter || msg = FinishedMessage then closeWriter()
  
  /// A List with all registered listeners
  let listeners = new Collections.Generic.List<ITraceListener>()
  
  /// Allows to register a new Xml listeners
  let addXmlListener xmlOutputFile = listeners.Add(new NAntXmlTraceListener(xmlOutputFile))
  
  // register listeners
  listeners.Add defaultConsoleTraceListener
  if hasBuildParam "logfile" || buildServer = CCNet then addXmlListener xmlOutputFile
  
  /// Allows to post messages to all trace listeners
  let postMessage x = listeners.ForEach (fun listener -> listener.Write x)