private void FlushBufferAndStart() { RemoteSettingsLogMessage result; lock (flushLock) { if (isStarted) { return; } List <KeyValuePair <string, string> > mainIdentifiers = new List <KeyValuePair <string, string> > { new KeyValuePair <string, string>("applicationName", filterProvider.GetApplicationName()), new KeyValuePair <string, string>("applicationVersion", filterProvider.GetApplicationVersion()), new KeyValuePair <string, string>("branchName", filterProvider.GetBranchBuildFrom()) }; settingsProvider.MainIdentifiers = mainIdentifiers; settingsProvider.Path = Path.GetTempPath(); settingsProvider.Folder = "VSRemoteSettingsLog"; logFile.Initialize(settingsProvider); while (Buffer.TryDequeue(out result)) { LogMessageNoBuffer(result); } isStarted = true; } while (Buffer.TryDequeue(out result)) { LogMessageNoBuffer(result); } }
/// <summary> /// Channel Start /// Get the session ID information and start a log file writer /// </summary> /// <param name="sessionID"></param> public void Start(string sessionID) { settingsProvider.MainIdentifiers = new KeyValuePair <string, string>[1] { new KeyValuePair <string, string>("session_id", sessionID) }; settingsProvider.Path = Path.GetTempPath(); settingsProvider.Folder = "VSTelemetryLog"; isChannelStarted = true; logFile.Initialize(settingsProvider); }