#define DEBUG namespace Caliburn.Micro.Core { using System; using System.Diagnostics; /// /// A simple logger thats logs everything to the debugger. /// public class DebugLog : ILog { private readonly string typeName; /// /// Initializes a new instance of the class. /// /// The type. public DebugLog(Type type) { typeName = type.FullName; } /// /// Logs the message as info. /// /// A formatted message. /// Parameters to be injected into the formatted message. public void Info(string format, params object[] args) { Debug.WriteLine("[{1}] INFO: {0}", string.Format(format, args), typeName); } /// /// Logs the message as a warning. /// /// A formatted message. /// Parameters to be injected into the formatted message. public void Warn(string format, params object[] args) { Debug.WriteLine("[{1}] WARN: {0}", string.Format(format, args), typeName); } /// /// Logs the exception. /// /// The exception. public void Error(Exception exception) { Debug.WriteLine("[{1}] ERROR: {0}", exception, typeName); } } }