winget-cli

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

TraceLogger.h (793B)


      1 // Copyright (c) Microsoft Corporation.
      2 // Licensed under the MIT License.
      3 #pragma once
      4 #include <AppInstallerLogging.h>
      5 #include <AppInstallerTelemetry.h>
      6 
      7 #include <string>
      8 #include <string_view>
      9 
     10 namespace AppInstaller::Logging
     11 {
     12     // Log ETW events for tracing.
     13     // Doesn't save events to a file on disk.
     14     struct TraceLogger : ILogger
     15     {
     16         TraceLogger() = default;
     17 
     18         ~TraceLogger() = default;
     19 
     20         // ILogger
     21         std::string GetName() const override;
     22 
     23         void Write(Channel channel, Level, std::string_view message) noexcept override;
     24 
     25         void WriteDirect(Channel channel, Level level, std::string_view message) noexcept override;
     26 
     27         // Adds a TraceLogger to the current Log
     28         static void Add();
     29     };
     30 }