Exemplo n.º 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);
     };
 }
Exemplo n.º 2
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;
     };
 }
Exemplo n.º 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);
        }
Exemplo n.º 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;
        }