Exemplo n.º 1
0
        public static void Init(string path, Action flushCallback = null)
        {
            try
            {
                FlushCallback = flushCallback;

                if (!Directory.Exists(path))
                {
                    Directory.CreateDirectory(path);
                }
                IEnumerable filesEnumerator = Directory.EnumerateFiles(path);

                string fullpath;
                int    filesCount = 0;
                foreach (object file in filesEnumerator)
                {
                    filesCount++;
                }

                fullpath = path + @"\traceLog" + filesCount + ".log";
                writer   = new StreamWriter(fullpath, append: true);

                queue.Start();
            }
            catch (Exception ex)
            {
                FrontDisplay.RefreshLEDs(LedType.Red);
                Logger.Error(ex, "file logger init");
            }
        }