using System; using System.Collections.Generic; using System.Diagnostics; using System.Linq; using System.Reflection; using System.Text; using System.Threading.Tasks; namespace Tango.Logging { /// /// Represents a library logger for routing logs to the Visual Studio output window. /// public class VSOutputLogger : ILogger { private String _assembly_name; /// /// Initializes a new instance of the class. /// public VSOutputLogger(String projectName = null) { Enabled = true; _assembly_name = projectName != null ? projectName : Assembly.GetEntryAssembly().GetName().Name + ": "; } /// /// Called when a new library trace is available. /// /// The output. public void OnLog(LogItemBase output) { Debug.WriteLine(_assembly_name + output.ToString()); } private bool _isEnabled; /// /// Gets or sets a value indicating whether this is enabled. /// public bool Enabled { get { return _isEnabled; } set { _isEnabled = value; } } } }