Provides a multilevel switch to control tracing and debug output without recompiling your code.
Protected Member Functions | |
| auto | on_value_changed () -> void override |
| Invoked when the value of the value property changes. | |
| switch_object (const xtd::string &display_name, const xtd::string &description) | |
| Initializes a new instance of the switch_object class. | |
| auto | switch_setting () const noexcept -> xtd::int32 |
| Gets the current setting for this switch. | |
| auto | switch_setting (xtd::int32 switch_setting) -> void |
| Sets the current setting for this switch. | |
| virtual auto | get_supported_attributes () const noexcept -> xtd::array< xtd::string > |
| Gets the custom attributes supported by the switch. | |
| virtual auto | on_switch_setting_changed () -> void |
| Invoked when the switch_setting property is changed. | |
Public Constructors | |
| source_switch (const xtd::string &name) | |
| Initializes a new instance of the source_switch class, specifying the name of the source. | |
| source_switch (const xtd::string &display_name, const xtd::string &default_switch_value) | |
| Initializes a new instance of the source_switch class, specifying the display name and the default value for the source switch. | |
Public Properties | |
| auto | level () const noexcept -> xtd::diagnostics::source_levels |
| Gets the level of the switch. | |
| auto | level (xtd::diagnostics::source_levels level) -> void |
| Sets the level of the switch. | |
Public Methods | |
| auto | should_trace (xtd::diagnostics::trace_event_type event_type) noexcept -> bool |
| Determines if trace listeners should be called, based on the trace event type. | |
Additional Inherited Members | |
| using | attribute_collection |
| Represents the attributes collection. | |
| auto | attributes () const noexcept -> const attribute_collection & |
| Gets the custom switch attributes. | |
| auto | attributes () noexcept -> attribute_collection & |
| Gets the custom switch attributes. | |
| auto | attributes (const attribute_collection &attributes) noexcept -> void |
| Sets the custom switch attributes. | |
| auto | description () const noexcept -> const xtd::string & |
| Gets a description of the switch. | |
| auto | display_name () const noexcept -> const xtd::string & |
| Gets a name used to identify the switch. | |
| auto | value () const noexcept -> const xtd::string & |
| Gets the value of the switch. | |
| auto | value (const xtd::string &value) -> void |
| Sets the value of the switch. | |
| auto | equals (const xtd::object &obj) const noexcept -> bool override |
| Determines whether the specified object is equal to the current object. | |
| auto | equals (const switch_object &other) const noexcept -> bool override |
| Determines whether the specified object is equal to the current object. | |
| object ()=default | |
| Create a new instance of the ultimate base class object. | |
| virtual auto | get_hash_code () const noexcept -> xtd::usize |
| Serves as a hash function for a particular type. | |
| virtual auto | get_type () const noexcept -> type_object |
| Gets the type of the current instance. | |
| template<typename object_t> | |
| auto | memberwise_clone () const -> xtd::unique_ptr_object< object_t > |
| Creates a shallow copy of the current object. | |
| virtual auto | to_string () const -> xtd::string |
| Returns a xtd::string that represents the current object. | |
| template<typename object_a_t, typename object_b_t> | |
| static auto | equals (const object_a_t &object_a, const object_b_t &object_b) noexcept -> bool |
| Determines whether the specified object instances are considered equal. | |
| template<typename object_a_t, typename object_b_t> | |
| static auto | reference_equals (const object_a_t &object_a, const object_b_t &object_b) noexcept -> bool |
| Determines whether the specified object instances are the same instance. | |
|
explicit |
Initializes a new instance of the source_switch class, specifying the name of the source.
| name | The name of the source. |
| xtd::diagnostics::source_switch::source_switch | ( | const xtd::string & | display_name, |
| const xtd::string & | default_switch_value ) |
Initializes a new instance of the source_switch class, specifying the display name and the default value for the source switch.
| display_name | The name of the source. |
| default_switch_value | The default value for the switch. |
|
nodiscardnoexcept |
Gets the level of the switch.
| auto xtd::diagnostics::source_switch::level | ( | xtd::diagnostics::source_levels | level | ) | -> void |
Sets the level of the switch.
| level | One of the SourceLevels values that represents the event level of the switch. |
|
nodiscardnoexcept |
Determines if trace listeners should be called, based on the trace event type.
| event_type | One of the trace_event_type values. |
|
overrideprotectedvirtual |
Invoked when the value of the value property changes.
Reimplemented from xtd::diagnostics::switch_object.