Пример #1
0
        /// <summary>
        /// 
        /// </summary>
        public static void Initialize(string file, bool async)
        {
            if (_singleton != null)
            {
                return;
            }

            _singleton = new LogFile(file, async);
        }
Пример #2
0
        /// <summary>
        /// 
        /// </summary>
        public static void Destroy()
        {
            if (_singleton == null)
            {
                return;
            }

            _singleton._streamClose = true;
            _singleton._isAlive = false;
            if (_singleton._task != null) _singleton._task.Wait();
            _singleton._writer.Close();
            _singleton = null;
        }