Fixes #202 This PR fixes code style for the project files. The Problem Different files in the project use different code style. That is not consistent and leads to harder maintenance of the project. Description of the changes: Have investigated and determined the most used code style across the given codebase Have configured IDE and applied code style to all project files. Have crafted clang-formatter config. see https://clang.llvm.org/docs/ClangFormat.html https://clang.llvm.org/docs/ClangFormatStyleOptions.html Some cases were fixed manually How changes were validated: manual/ad-hoc testing, automated testing All tests pass as before because these are only code style changes. Additional Please review, and let me know if I have any mistake in the code style. In case of any mistake, I will change the configuration and re-apply it to the project.
42 lines
1.9 KiB
C++
42 lines
1.9 KiB
C++
// Copyright (c) Microsoft Corporation. All rights reserved.
|
|
// Licensed under the MIT License.
|
|
|
|
#pragma once
|
|
|
|
namespace CalculatorApp
|
|
{
|
|
class AppLifecycleLogger
|
|
{
|
|
public:
|
|
AppLifecycleLogger(AppLifecycleLogger const&) = delete;
|
|
AppLifecycleLogger const& operator=(AppLifecycleLogger const&) = delete;
|
|
~AppLifecycleLogger();
|
|
static AppLifecycleLogger& GetInstance();
|
|
bool GetTraceLoggingProviderEnabled() const;
|
|
|
|
void LaunchUIResponsive() const;
|
|
void LaunchVisibleComplete() const;
|
|
void ResumeUIResponsive() const;
|
|
void ResumeVisibleComplete() const;
|
|
|
|
void ResizeUIResponsive() const;
|
|
void ResizeVisibleComplete() const;
|
|
void ResizeUIResponsive(int32_t viewId) const;
|
|
void ResizeVisibleComplete(int32_t viewId) const;
|
|
|
|
private:
|
|
// Make the object construction private to allow singleton access to this class
|
|
AppLifecycleLogger();
|
|
|
|
// Any new Log method should
|
|
// a) Decide the level of logging. This will help us in limiting recording of events only up to a certain level. See this link for guidance
|
|
// https://msdn.microsoft.com/en-us/library/windows/desktop/aa363742(v=vs.85).aspx We're using Verbose level for events that are called frequently and
|
|
// needed only for debugging or capturing perf for specific scenarios b) Should decide whether or not to log to telemetry and pass
|
|
// TraceLoggingKeyword(MICROSOFT_KEYWORD_TELEMETRY) accordingly c) Should accept a variable number of additional data arguments if needed
|
|
void LogAppLifecycleEvent(winrt::hstring const& eventName, winrt::Windows::Foundation::Diagnostics::LoggingFields const& fields) const;
|
|
void PopulateAppInfo(winrt::Windows::Foundation::Diagnostics::LoggingFields& fields) const;
|
|
|
|
winrt::Windows::Foundation::Diagnostics::LoggingChannel m_appLifecycleProvider;
|
|
};
|
|
}
|