Exemplo n.º 1
0
        public JsonTracer(string providerName, Guid providerActivityId, string activityName, string enlistmentId, bool disableTelemetry = false)
            : this(
                null,
                providerActivityId,
                activityName,
                EventLevel.Informational,
                Keywords.Telemetry)
        {
            if (!disableTelemetry)
            {
                string gitBinRoot = ScalarPlatform.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, this);
                if (daemonListener != null)
                {
                    this.listeners.Add(daemonListener);
                }
            }
        }
Exemplo n.º 2
0
        public void SetGitCommandSessionId(string sessionId)
        {
            TelemetryDaemonEventListener daemonListener = this.listeners.FirstOrDefault(x => x is TelemetryDaemonEventListener) as TelemetryDaemonEventListener;

            if (daemonListener != null)
            {
                daemonListener.GitCommandSessionId = sessionId;
            }
        }