public static void WriteEvent(string name, long millis)
 {
     if (logger != null)
     {
         logger.AddEntry(new CsvLogEntry(name, millis.ToString(CultureInfo.InvariantCulture)));
     }
 }
        public static void SetLogFilePath(string logFilePath)
        {
            if (logger != null)
            {
                IDisposable disp = logger;
                logger = null;
                disp.Dispose();
            }

            if (logFilePath != null)
            {
                logFilePath = Path.GetFullPath(logFilePath);
                if (File.Exists(logFilePath))
                    File.Delete(logFilePath);
                FileLogger newLogger = new FileLogger(logFilePath);
                newLogger.AddEntry(new CsvLogEntry("Name", "ElapsedMillis"));
                logger = newLogger;
            }
        }
        public static void SetLogFilePath(string logFilePath)
        {
            if (logger != null)
            {
                IDisposable disp = logger;
                logger = null;
                disp.Dispose();
            }

            if (logFilePath != null)
            {
                logFilePath = Path.GetFullPath(logFilePath);
                if (File.Exists(logFilePath))
                {
                    File.Delete(logFilePath);
                }
                FileLogger newLogger = new FileLogger(logFilePath);
                newLogger.AddEntry(new CsvLogEntry("Name", "ElapsedMillis"));
                logger = newLogger;
            }
        }