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.
trace_options.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 trace_options {
23  none = 0,
27  date_time = 0b10,
29  timestamp = 0b100,
31  process_id = 0b1000,
33  thread_id = 0b10000,
35  callstack = 0b100000
36  };
37 
39  inline xtd::diagnostics::trace_options& operator^=(xtd::diagnostics::trace_options& lhs, xtd::diagnostics::trace_options rhs) {lhs = static_cast<xtd::diagnostics::trace_options>(static_cast<int>(lhs) ^ static_cast<int>(rhs)); return lhs;}
40  inline xtd::diagnostics::trace_options& operator&=(xtd::diagnostics::trace_options& lhs, xtd::diagnostics::trace_options rhs) {lhs = static_cast<xtd::diagnostics::trace_options>(static_cast<int>(lhs) & static_cast<int>(rhs)); return lhs;}
41  inline xtd::diagnostics::trace_options& operator|=(xtd::diagnostics::trace_options& lhs, xtd::diagnostics::trace_options rhs) {lhs = static_cast<xtd::diagnostics::trace_options>(static_cast<int>(lhs) | static_cast<int>(rhs)); return lhs;}
42  inline xtd::diagnostics::trace_options& operator+=(xtd::diagnostics::trace_options& lhs, xtd::diagnostics::trace_options rhs) {lhs = static_cast<xtd::diagnostics::trace_options>(static_cast<int>(lhs) + static_cast<int>(rhs)); return lhs;}
43  inline xtd::diagnostics::trace_options& operator-=(xtd::diagnostics::trace_options& lhs, xtd::diagnostics::trace_options rhs) {lhs = static_cast<xtd::diagnostics::trace_options>(static_cast<int>(lhs) - static_cast<int>(rhs)); return lhs;}
44  inline xtd::diagnostics::trace_options operator^(xtd::diagnostics::trace_options lhs, xtd::diagnostics::trace_options rhs) {return static_cast<xtd::diagnostics::trace_options>(static_cast<int>(lhs) ^ static_cast<int>(rhs));}
45  inline xtd::diagnostics::trace_options operator&(xtd::diagnostics::trace_options lhs, xtd::diagnostics::trace_options rhs) {return static_cast<xtd::diagnostics::trace_options>(static_cast<int>(lhs) & static_cast<int>(rhs));}
46  inline xtd::diagnostics::trace_options operator|(xtd::diagnostics::trace_options lhs, xtd::diagnostics::trace_options rhs) {return static_cast<xtd::diagnostics::trace_options>(static_cast<int>(lhs) | static_cast<int>(rhs));}
47  inline xtd::diagnostics::trace_options operator+(xtd::diagnostics::trace_options lhs, xtd::diagnostics::trace_options rhs) {return static_cast<xtd::diagnostics::trace_options>(static_cast<int>(lhs) + static_cast<int>(rhs));}
48  inline xtd::diagnostics::trace_options operator-(xtd::diagnostics::trace_options lhs, xtd::diagnostics::trace_options rhs) {return static_cast<xtd::diagnostics::trace_options>(static_cast<int>(lhs) - static_cast<int>(rhs));}
49  inline xtd::diagnostics::trace_options operator~(xtd::diagnostics::trace_options lhs) {return static_cast<xtd::diagnostics::trace_options>(~static_cast<int>(lhs));}
50  inline std::ostream& operator<<(std::ostream& os, xtd::diagnostics::trace_options value) {return os << to_string(value, {{xtd::diagnostics::trace_options::none, "none"}, {diagnostics::trace_options::logical_operation_stack, "logical_operation_stack"}, {diagnostics::trace_options::date_time, "date_time"}, {diagnostics::trace_options::timestamp, "timestamp"}, {diagnostics::trace_options::process_id, "process_id"}, {diagnostics::trace_options::thread_id, "thread_id"}, {diagnostics::trace_options::callstack, "callstack"}});}
51  inline std::wostream& operator<<(std::wostream& os, xtd::diagnostics::trace_options value) {return os << to_string(value, {{xtd::diagnostics::trace_options::none, L"none"}, {diagnostics::trace_options::logical_operation_stack, L"logical_operation_stack"}, {diagnostics::trace_options::date_time, L"date_time"}, {diagnostics::trace_options::timestamp, L"timestamp"}, {diagnostics::trace_options::process_id, L"process_id"}, {diagnostics::trace_options::thread_id, L"thread_id"}, {diagnostics::trace_options::callstack, L"callstack"}});}
53  }
54 }
Write the call stack, which is represented by the return value of the Environment.StackTrace property.
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: system_report.h:17
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
Represents an instant in time, typically expressed as a date and time of day.
Definition: date_time.h:71
Write the process identity, which is represented by the return value of the Process.Id property.
Write the thread identity, which is represented by the return value of the Thread.ManagedThreadId property for the current thread.
Do not write any elements.
trace_options
Specifies trace data options to be written to the trace output.
Definition: trace_options.h:21
Write the logical operation stack, which is represented by the return value of the CorrelationManager...
Write the timestamp, which is represented by the return value of the GetTimestamp method...