winget-cli

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

StdErrLogger.h (842B)


      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 stderr stream.
      9     struct StdErrLogger : ILogger
     10     {
     11         StdErrLogger() = default;
     12 
     13         ~StdErrLogger() = default;
     14 
     15         // ILogger
     16         std::string GetName() const override;
     17 
     18         void Write(Channel channel, Level level, std::string_view message) noexcept override;
     19 
     20         void WriteDirect(Channel channel, Level level, std::string_view message) noexcept override;
     21 
     22         // Adds OutputDebugStringLogger to the current Log
     23         static void Add();
     24 
     25         // Removes OutputDebugStringLogger from the current Log
     26         static void Remove();
     27 
     28     private:
     29         Level m_level = Level::Error;
     30     };
     31 }