winget-cli

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

OutputDebugStringLogger.h (885B)


      1 // Copyright (c) Microsoft Corporation.
      2 // Licensed under the MIT License.
      3 #pragma once
      4 #include <AppInstallerLogging.h>
      5 
      6 namespace AppInstaller::Logging
      7 {
      8     // Sends logs to the OutputDebugString function.
      9     // Intended for use during initialization debugging.
     10     struct OutputDebugStringLogger : ILogger
     11     {
     12         OutputDebugStringLogger() = default;
     13 
     14         ~OutputDebugStringLogger() = default;
     15 
     16         // ILogger
     17         std::string GetName() const override;
     18 
     19         void Write(Channel channel, Level, std::string_view message) noexcept override;
     20 
     21         void WriteDirect(Channel channel, Level level, std::string_view message) noexcept override;
     22 
     23         // Adds OutputDebugStringLogger to the current Log
     24         static void Add();
     25 
     26         // Removes OutputDebugStringLogger from the current Log
     27         static void Remove();
     28     };
     29 }