Exemplo n.º 1
0
        public Logger()
        {
            Date = DateTime.Now.ToString(DateFormat);
            if (!Directory.Exists(LogPath))
            {
                Directory.CreateDirectory(LogPath);
            }
            sw    = new StreamWriter(LogPath + Date + ".log", true, Encoding.UTF8);
            queue = new SynchronizedQueue <Log>(true);
            Thread thread = new Thread(new ThreadStart(Record))
            {
                Name         = "日志线程",
                IsBackground = true
            };

            thread.Start();
        }