public JsonTracer(string providerName, Guid providerActivityId, string activityName, string enlistmentId, string mountId, bool disableTelemetry = false) : this( null, providerActivityId, activityName, EventLevel.Informational, Keywords.Telemetry) { if (!disableTelemetry) { string gitBinRoot = GVFSPlatform.Instance.GitInstallation.GetInstalledGitBinPath(); // If we do not have a git binary, then we cannot check if we should set up telemetry // We also cannot log this, as we are setting up tracer. if (string.IsNullOrEmpty(gitBinRoot)) { return; } TelemetryDaemonEventListener daemonListener = TelemetryDaemonEventListener.CreateIfEnabled(gitBinRoot, providerName, enlistmentId, mountId); if (daemonListener != null) { this.listeners.Add(daemonListener); } } }
public void SetGitCommandSessionId(string sessionId) { TelemetryDaemonEventListener daemonListener = this.listeners.FirstOrDefault(x => x is TelemetryDaemonEventListener) as TelemetryDaemonEventListener; if (daemonListener != null) { daemonListener.GitCommandSessionId = sessionId; } }