xtd 0.2.0
Loading...
Searching...
No Matches
trace_switch.hpp
Go to the documentation of this file.
1
4#pragma once
5#include "switch_object.hpp"
6#include "debug.hpp"
7#include "trace_level.hpp"
8
10namespace xtd {
12 namespace diagnostics {
31 public:
33
46 trace_switch(const xtd::string& display_name, const xtd::string& description, const xtd::string& default_switch_value);
48
50
55 [[nodiscard]] auto level() const noexcept -> xtd::diagnostics::trace_level;
59 auto level(xtd::diagnostics::trace_level level) noexcept -> void;
60
63 [[nodiscard]] auto trace_error() const noexcept -> bool;
64
67 [[nodiscard]] auto trace_info() const noexcept -> bool;
68
71 [[nodiscard]] auto trace_verbose() const noexcept -> bool;
72
75 [[nodiscard]] auto trace_warning() const noexcept -> bool;
77
78 protected:
80
82 auto on_switch_setting_changed() -> void override;
83 auto on_value_changed() -> void override;
85 };
86 }
87}
Provides an abstract base class to create new debugging and tracing switches.
Definition switch_object.hpp:36
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 trace_info() const noexcept -> bool
Gets a value indicating whether the switch allows informational messages.
auto trace_error() const noexcept -> bool
Gets a value indicating whether the switch allows error-handling messages.
auto on_value_changed() -> void override
Invoked when the value property is changed.
auto level() const noexcept -> xtd::diagnostics::trace_level
Gets the trace level that determines the messages the switch allows.
trace_switch(const xtd::string &display_name, const xtd::string &description, const xtd::string &default_switch_value)
Initializes a new instance of the xtd::diagnostics::trace_switch class, using the specified display n...
trace_switch(const xtd::string &display_name, const xtd::string &description)
Initializes a new instance of the xtd::diagnostics::trace_switch class, using the specified display n...
auto on_switch_setting_changed() -> void override
Invoked when the switch_setting property is changed.
auto trace_warning() const noexcept -> bool
Gets a value indicating whether the switch allows warning messages.
auto trace_verbose() const noexcept -> bool
Gets a value indicating whether the switch allows all messages.
Contains xtd::diagnostics::debug class.
#define core_export_
Define shared library export.
Definition core_export.hpp:13
xtd::basic_string< char > string
Represents text as a sequence of UTF-8 code units.
Definition __string_definitions.hpp:43
trace_level
Specifies what messages to output for the debug, trace and trace_switch classes.
Definition trace_level.hpp:24
The xtd::diagnostics namespace provides classes that allow you to interact with system processes,...
Definition assert_dialog_result.hpp:10
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition abstract_object.hpp:8
Contains xtd::diagnostics::switch_object class.
Contains xtd::diagnostics::trace_level enum class.