xtd - Reference Guide  0.1.0
Modern c++17/20 framework to create console, GUI and unit test applications on Windows, macOS, Linux, iOS and android.
Loading...
Searching...
No Matches
source_levels.h
Go to the documentation of this file.
1
4#pragma once
5#include "../ustring.h"
6
8namespace xtd {
10 namespace diagnostics {
18 enum class source_levels {
20 all = 0b1111111111111111,
22 off = 0,
24 critical = 0b1,
26 error = 0b11,
28 warning = 0b111,
30 information = 0b1111,
32 verbose = 0b11111,
34 activity_tracing = 0b1111111100000000,
35 };
36
38 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;}
39 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;}
40 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;}
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) {return static_cast<source_levels>(static_cast<long long>(lhs) + static_cast<long long>(rhs));}
44 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));}
45 inline source_levels operator ~(source_levels rhs) {return static_cast<source_levels>(~static_cast<long long>(rhs));}
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 lhs, source_levels rhs) {return static_cast<source_levels>(static_cast<long long>(lhs) ^ static_cast<long long>(rhs));}
50 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"}});}
52 }
53}
source_levels
Specifies the levels of trace messages filtered by the source switch and event type filter....
Definition: source_levels.h:18
std::string to_string(const value_t &value, const std::string &fmt, const std::locale &loc)
Convert a specified value into a string with specified format and locale.
Definition: to_string.h:37
@ verbose
Allows critical, error, warning, information, and verbose events through.
@ off
Does not allow any events through.
@ activity_tracing
Allows the stop, start, suspend, transfer, and resume events through.
@ warning
Allows critical, error, and warning events through.
@ critical
Allows only Critical events through.
@ all
Allows all events through.
@ information
Allows Critical, error, warning, and information events through.
@ error
Allows critical and error events through.
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition: system_report.h:17