示例#1
0
 public static void log(string text, string trace)
 {
     lock (lockObject)
     {
         if (_inst == null)
         {
             _inst = new SMainLog(GetFileName());
         }
         _inst.Log(text, trace);
         _inst.close();
         _inst = null;
     }
 }
示例#2
0
        public static void log(Exception ex, string text)
        {
            lock (lockObject)
            {
                if (_inst == null)
                {
                    _inst = new SMainLog(GetFileName());
                }

                _inst.Log("[" + text + "] Error: " + ex.Message, ex.StackTrace);
                _inst.close();
                _inst = null;
            }
            if (OnWrite != null)
            {
                OnWrite(ex.Message, text);
            }
        }
示例#3
0
        public static void log(Exception ex)
        {
            lock (lockObject)
            {
                if (_inst == null)
                {
                    _inst = new SMainLog(GetFileName());
                }

                _inst.Log("Error: " + ex.Message, ex.StackTrace);
                if (ex.InnerException != null)
                {
                    _inst.Log("InnerException: " + ex.InnerException.Message, ex.InnerException.StackTrace);
                }
                _inst.close();
                _inst = null;
            }
            if (OnWrite != null)
            {
                OnWrite(ex.Message, ex.StackTrace);
            }
        }