xtd 0.2.0
source_switch.h
Go to the documentation of this file.
1 #pragma once
5 #include "../ustring.h"
6 #include "source_levels.h"
7 #include "trace_event_type.h"
8 #include "switch_base.h"
9 
11 namespace xtd {
13  namespace diagnostics {
29  class core_export_ source_switch : public xtd::diagnostics::switch_base {
30  public:
32 
37  explicit source_switch(const xtd::ustring& name);
42  source_switch(const xtd::ustring& display_name, const xtd::ustring& default_switch_value);
44 
46 
51  xtd::diagnostics::source_levels level() const noexcept;
55  void level(xtd::diagnostics::source_levels level);
57 
59 
66  bool should_trace(xtd::diagnostics::trace_event_type event_type) noexcept;
68 
69  protected:
72  void on_value_changed() override;
73  };
74  }
75 }
Provides a multilevel switch to control tracing and debug output without recompiling your code...
Definition: source_switch.h:29
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:23
Represents text as a sequence of UTF-8 code units.
Definition: ustring.h:46
Contains xtd::diagnostics::trace_event_type enum class.
Contains xtd::diagnostics::source_levels enum class.
Contains xtd::diagnostics::switch_base class.
Provides an abstract base class to create new debugging and tracing switches.
Definition: switch_base.h:34
trace_event_type
Identifies the type of event that has caused the trace.
Definition: trace_event_type.h:23