winget-cli

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

Logging.h (616B)


      1 // Copyright (c) Microsoft Corporation.
      2 // Licensed under the MIT License.
      3 
      4 #pragma once
      5 
      6 #include <chrono>
      7 #include <functional>
      8 #include <string>
      9 
     10 namespace SFS
     11 {
     12 enum class LogSeverity
     13 {
     14     Info,
     15     Warning,
     16     Error,
     17     Verbose,
     18 };
     19 
     20 struct LogData
     21 {
     22     LogSeverity severity;
     23     const char* message;
     24     const char* file;
     25     unsigned line;
     26     const char* function;
     27     std::chrono::time_point<std::chrono::system_clock> time;
     28 };
     29 
     30 using LoggingCallbackFn = std::function<void(const LogData&)>;
     31 
     32 std::string_view ToString(LogSeverity severity) noexcept;
     33 }; // namespace SFS