-
Notifications
You must be signed in to change notification settings - Fork 0
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
Convert global loggers to Thread local loggers #3
base: master
Are you sure you want to change the base?
Conversation
…consturction to a public method within TelemetryTraceLogging.
@@ -102,6 +105,8 @@ namespace AppInstaller::CLI::Execution | |||
} | |||
|
|||
virtual void SetExecutionStage(Workflow::ExecutionStage stage, bool); | |||
|
|||
void SetThreadLocalThreadGlobals(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will need to return the internal RAII type that ThreadGlobals will return from its SetActive type function.
void TelemetryTraceLogger::LogFailure(const wil::FailureInfo& failure) const noexcept | ||
{ | ||
if (IsTelemetryEnabled()) | ||
{ | ||
TraceLoggingWriteActivity(g_hTelemetryProvider, | ||
TraceLoggingWriteActivity(g_hTraceProvider, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why update all of these lines just to change the global name? What value is there in changing the name of the global?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The value is not in any better functionality but in it communicating truly what it is. The provider is NOW not only used for logging Telemetry but Diagnostic events as well.
@@ -31,7 +31,7 @@ namespace AppInstaller::Logging | |||
// ILogger | |||
virtual std::string GetName() const override; | |||
|
|||
virtual void Write(Channel channel, Level level, std::string_view message) noexcept override; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will fix this!
@@ -64,6 +64,7 @@ namespace AppInstaller::Logging | |||
// Send to a string first to create a single block to write to a file. | |||
std::stringstream strstr; | |||
strstr << std::chrono::system_clock::now() << " [" << std::setw(GetMaxChannelNameLength()) << std::left << std::setfill(' ') << GetChannelName(channel) << "] " << message; | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will remove the extra line!
}; | ||
|
||
// Helper to make the call sites look clean. | ||
TelemetryTraceLogger& Telemetry(); | ||
|
||
// Turns on wil failure telemetry and logging. | ||
void EnableWilFailureTelemetry(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will revert the location of this method's declaration to reflect no change to this method!
@@ -147,6 +161,9 @@ namespace AppInstaller::Logging | |||
DestructionToken m_token; | |||
}; | |||
|
|||
// Turns on wil failure telemetry and logging. | |||
void EnableWilFailureTelemetry(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will revert the location of this method's declaration to reflect no change to this method!
virtual std::string GetName() const override; | ||
virtual void Write(Channel channel, Level, std::string_view message) noexcept override; | ||
}; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will add new line at the end of the file
src/WinGetUtil/Exports.cpp
Outdated
@@ -27,6 +27,7 @@ extern "C" | |||
AppInstaller::Logging::Log().EnableChannel(AppInstaller::Logging::Channel::All); | |||
AppInstaller::Logging::Log().SetLevel(AppInstaller::Logging::Level::Verbose); | |||
AppInstaller::Logging::EnableWilFailureTelemetry(); | |||
AppInstaller::Logging::Telemetry().SetUserSettingsStatus(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missed this! Will remove this call !
…ght and Address spelligs
No description provided.