xtd - Reference Guide  0.2.0
Modern c++17/20 framework to create console, GUI and unit test applications on Windows, macOS, Linux, iOS and android.
source_levels.h
Go to the documentation of this file.
1 #pragma once
5 #include "../ustring.h"
6 
8 namespace xtd {
10  namespace diagnostics {
21  enum class source_levels {
23  all = 0b1111111111111111,
25  off = 0,
27  critical = 0b1,
29  error = 0b11,
31  warning = 0b111,
33  information = 0b1111,
35  verbose = 0b11111,
37  activity_tracing = 0b1111111100000000,
38  };
39 
41  inline source_levels& operator +=(source_levels& lhs, source_levels rhs) {lhs = static_cast<source_levels>(static_cast<long long>(lhs) + static_cast<long long>(rhs)); return lhs;}
42  inline source_levels& operator -=(source_levels& lhs, source_levels rhs) {lhs = static_cast<source_levels>(static_cast<long long>(lhs) - static_cast<long long>(rhs)); return lhs;}
43  inline source_levels& operator &=(source_levels& lhs, source_levels rhs) {lhs = static_cast<source_levels>(static_cast<long long>(lhs) & static_cast<long long>(rhs)); return lhs;}
44  inline source_levels& operator |=(source_levels& lhs, source_levels rhs) {lhs = static_cast<source_levels>(static_cast<long long>(lhs) | static_cast<long long>(rhs)); return lhs;}
45  inline source_levels& operator ^=(source_levels& lhs, source_levels rhs) {lhs = static_cast<source_levels>(static_cast<long long>(lhs) ^ static_cast<long long>(rhs)); return lhs;}
46  inline source_levels operator +(source_levels lhs, source_levels rhs) {return static_cast<source_levels>(static_cast<long long>(lhs) + static_cast<long long>(rhs));}
47  inline source_levels operator -(source_levels lhs, source_levels rhs) {return static_cast<source_levels>(static_cast<long long>(lhs) - static_cast<long long>(rhs));}
48  inline source_levels operator ~(source_levels rhs) {return static_cast<source_levels>(~static_cast<long long>(rhs));}
49  inline source_levels operator &(source_levels lhs, source_levels rhs) {return static_cast<source_levels>(static_cast<long long>(lhs) & static_cast<long long>(rhs));}
50  inline source_levels operator |(source_levels lhs, source_levels rhs) {return static_cast<source_levels>(static_cast<long long>(lhs) | static_cast<long long>(rhs));}
51  inline source_levels operator ^(source_levels lhs, source_levels rhs) {return static_cast<source_levels>(static_cast<long long>(lhs) ^ static_cast<long long>(rhs));}
53  inline std::wostream& operator<<(std::wostream& os, xtd::diagnostics::source_levels value) {return os << to_string(value, {{diagnostics::source_levels::all, L"all"}, {diagnostics::source_levels::off, L"off"}, {diagnostics::source_levels::critical, L"critical"}, {diagnostics::source_levels::error, L"error"}, {diagnostics::source_levels::warning, L"warning"}, {diagnostics::source_levels::information, L"information"}, {diagnostics::source_levels::verbose, L"verbose"}, {diagnostics::source_levels::activity_tracing, L"activity_tracing"}});}
55  }
56 }
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: system_report.h:17
source_levels
Specifies the levels of trace messages filtered by the source switch and event type filter...
Definition: source_levels.h:21
std::string to_string(const date_time &value, const std::string &fmt, const std::locale &loc)
Convert a specified value into a string with specified format and locale.
Definition: date_time.h:1110
Allows critical and error events through.
Allows critical, error, and warning events through.
Allows the stop, start, suspend, transfer, and resume events through.
Allows Critical, error, warning, and information events through.
Allows all events through.
Does not allow any events through.
Allows only Critical events through.
Allows critical, error, warning, information, and verbose events through.