using Swan.Lite.Logging; namespace Swan.Logging { /// /// Represents a logger target. This target will write to the /// Debug console using System.Diagnostics.Debug. /// /// public class DebugLogger : TextLogger, ILogger { /// /// Initializes a new instance of the class. /// protected DebugLogger() { // Empty } /// /// Gets the current instance of DebugLogger. /// /// /// The instance. /// public static DebugLogger Instance { get; } = new DebugLogger(); /// /// Gets a value indicating whether a debugger is attached. /// /// /// true if this instance is debugger attached; otherwise, false. /// public static bool IsDebuggerAttached => System.Diagnostics.Debugger.IsAttached; /// public LogLevel LogLevel { get; set; } = IsDebuggerAttached ? LogLevel.Trace : LogLevel.None; /// public void Log(LogMessageReceivedEventArgs logEvent) { var (outputMessage, _) = GetOutputAndColor(logEvent); System.Diagnostics.Debug.Write(outputMessage); } /// public void Dispose() { // do nothing } } }