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

Add ODS logger and use it during init #4969

Merged
merged 2 commits into from
Nov 20, 2024

Conversation

JohnMcPMS
Copy link
Member

@JohnMcPMS JohnMcPMS commented Nov 14, 2024

Change

The user settings (and then group policy) initialization happen before we get the file logger set up. To be able to see into what is happening there more easily, this change creates a logger that uses OutputDebugString and uses it during the initial file logger creation.

Validation

Debugged and saw the group policy and settings logging come through the output.

Microsoft Reviewers: Open in CodeFlow

@JohnMcPMS JohnMcPMS requested a review from a team as a code owner November 14, 2024 19:41
Comment on lines +81 to +90
Logging::OutputDebugStringLogger::Remove();
#endif

Logging::UseGlobalTelemetryLoggerActivityIdOnly();

Execution::Context context{ std::cout, std::cin };
auto previousThreadGlobals = context.SetForCurrentThread();
auto previousThreadGlobals = context.SetForCurrentThread();

// Set up debug string logging during initialization
Logging::OutputDebugStringLogger::Add();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see why we have to remove the ODS logger only to add it immediately after. Couldn't we just add it before the #ifndef and remove it once in line 97?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The first one is added to the global logger, while the second one is added to the context logger.

@JohnMcPMS JohnMcPMS merged commit 25ccc2a into microsoft:master Nov 20, 2024
9 checks passed
@JohnMcPMS JohnMcPMS deleted the init-logging branch November 20, 2024 00:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants