xtd - Reference Guide  0.1.2
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_switch.h
Go to the documentation of this file.
1
4#pragma once
5#include "../ustring.h"
6#include "source_levels.h"
7#include "trace_event_type.h"
8#include "switch_base.h"
9
11namespace xtd {
13 namespace diagnostics {
23 public:
27 explicit source_switch(const xtd::ustring& name);
32 source_switch(const xtd::ustring& display_name, const xtd::ustring& default_switch_value);
33
42
49
50 protected:
53 void on_value_changed() override;
54 };
55 }
56}
Provides a multilevel switch to control tracing and debug output without recompiling your code.
Definition source_switch.h:22
xtd::diagnostics::source_levels level() const
Gets the level of the switch.
source_switch(const xtd::ustring &display_name, const xtd::ustring &default_switch_value)
Initializes a new instance of the source_switch class, specifying the display name and the default va...
source_switch(const xtd::ustring &name)
Initializes a new instance of the source_switch class, specifying the name of the source.
void level(xtd::diagnostics::source_levels level)
Sets the level of the switch.
void on_value_changed() override
Invoked when the value of the value property changes.
bool should_trace(xtd::diagnostics::trace_event_type event_type)
Determines if trace listeners should be called, based on the trace event type.
Provides an abstract base class to create new debugging and tracing switches.
Definition switch_base.h:26
const xtd::ustring & display_name() const
Gets a name used to identify the switch.
Represents text as a sequence of UTF-8 code units.
Definition ustring.h:48
trace_event_type
Identifies the type of event that has caused the trace.
Definition trace_event_type.h:18
source_levels
Specifies the levels of trace messages filtered by the source switch and event type filter....
Definition source_levels.h:18
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition system_report.h:17
Contains xtd::diagnostics::source_levels enum class.
Contains xtd::diagnostics::switch_base class.
Contains xtd::diagnostics::trace_event_type enum class.