示例#1
0
 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;
     };
 }
示例#3
0
        //private static log4net.ILog logger = null;

        public static TheLogger Instance()
        {
            if (instance == null)
            {
                lock (syncRoot)
                {
                    if (instance == null)
                    {
                        instance = new TheLogger();
                    }
                }
            }

            return(instance);
        }
示例#4
0
        //private static log4net.ILog logger = null;

        public static TheLogger Instance()
        {

            if (instance == null)
            {
                lock (syncRoot)
                {
                    if (instance == null)
                    {
                        instance = new TheLogger();
                    }
                }
            }

            return instance;
        }