Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Do not ignore messages we've been explicitly asked to log #76843

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 0 additions & 18 deletions src/VisualStudio/Core/Def/Telemetry/Shared/TelemetryLogger.cs
Original file line number Diff line number Diff line change
Expand Up @@ -104,11 +104,6 @@ public static TelemetryLogger Create(TelemetrySession session, bool logDelta)

public void Log(FunctionId functionId, LogMessage logMessage)
{
if (IgnoreMessage(logMessage))
{
return;
}

var telemetryEvent = new TelemetryEvent(GetEventName(functionId));
SetProperties(telemetryEvent, functionId, logMessage);

Expand All @@ -123,11 +118,6 @@ public void Log(FunctionId functionId, LogMessage logMessage)

public void LogBlockStart(FunctionId functionId, LogMessage logMessage, int blockId, CancellationToken cancellationToken)
{
if (IgnoreMessage(logMessage))
{
return;
}

var eventName = GetEventName(functionId);
var kind = GetKind(logMessage);

Expand All @@ -142,11 +132,6 @@ public void LogBlockStart(FunctionId functionId, LogMessage logMessage, int bloc

public void LogBlockEnd(FunctionId functionId, LogMessage logMessage, int blockId, int delta, CancellationToken cancellationToken)
{
if (IgnoreMessage(logMessage))
{
return;
}

Contract.ThrowIfFalse(_pendingScopes.TryRemove(blockId, out var scope));

var endEvent = GetEndEvent(scope);
Expand All @@ -163,9 +148,6 @@ public void LogBlockEnd(FunctionId functionId, LogMessage logMessage, int blockI
}
}

private static bool IgnoreMessage(LogMessage logMessage)
=> logMessage.LogLevel < LogLevel.Information;

private static LogType GetKind(LogMessage logMessage)
=> logMessage is KeyValueLogMessage kvLogMessage
? kvLogMessage.Kind
Expand Down
Loading