public static void LogToConsole() { ResolveLogger = delegate(string loggername) { var console = new TheLogger(); console.LogMessage = (s1, level) => Console.WriteLine(string.Format("{0:hh:mm:ss.FFFFF} : [{1}] ({2}) - {3}", DateTime.Now, loggername, level, s1)); console.LogException = (s1, ex, level) => Console.WriteLine(string.Format("{0:hh:mm:ss.FFFFF} : [{1}] ({2}) - {3} {4}", DateTime.Now, loggername, level, s1, ex.ToString())); return(console); }; }
public static void LogToConsole() { ResolveLogger = delegate(string loggername) { var console = new TheLogger(); console.LogMessage = (s1, level) => Console.WriteLine(string.Format("{0:hh:mm:ss.FFFFF} : [{1}] ({2}) - {3}", DateTime.Now, loggername, level, s1)); console.LogException = (s1, ex, level) => Console.WriteLine(string.Format("{0:hh:mm:ss.FFFFF} : [{1}] ({2}) - {3} {4}", DateTime.Now, loggername, level, s1, ex.ToString())); return console; }; }
//private static log4net.ILog logger = null; public static TheLogger Instance() { if (instance == null) { lock (syncRoot) { if (instance == null) { instance = new TheLogger(); } } } return(instance); }
//private static log4net.ILog logger = null; public static TheLogger Instance() { if (instance == null) { lock (syncRoot) { if (instance == null) { instance = new TheLogger(); } } } return instance; }