xtd - Reference Guide  0.1.1
Modern c++17/20 framework to create console, GUI and unit test applications on Windows, macOS, Linux, iOS and android.
trace_switch.h
Go to the documentation of this file.
1 #pragma once
5 #include "switch_base.h"
6 #include "debug.h"
7 #include "trace_level.h"
8 
10 namespace xtd {
12  namespace diagnostics {
22  public:
34  trace_switch(const xtd::ustring& display_name, const xtd::ustring& description, const xtd::ustring& default_switch_value);
35 
44 
47  bool trace_error() const;
48 
51  bool trace_info() const;
52 
55  bool trace_verbose() const;
56 
59  bool trace_warning() const;
60 
61  protected:
62  void on_switch_setting_changed() override;
63 
64  void on_value_changed() override;
65  };
66  }
67 }
Provides an abstract base class to create new debugging and tracing switches.
Definition: switch_base.h:26
const xtd::ustring & description() const
Gets a description of the switch.
const xtd::ustring & display_name() const
Gets a name used to identify the switch.
Provides a multilevel switch to control tracing and debug output without recompiling your code.
Definition: trace_switch.h:21
bool trace_warning() const
Gets a value indicating whether the switch allows warning messages.
void on_value_changed() override
Invoked when the value property is changed.
bool trace_error() const
Gets a value indicating whether the switch allows error-handling messages.
xtd::diagnostics::trace_level level() const
Gets the trace level that determines the messages the switch allows.
bool trace_verbose() const
Gets a value indicating whether the switch allows all messages.
void level(xtd::diagnostics::trace_level level)
Sets the trace level that determines the messages the switch allows.
trace_switch(const xtd::ustring &display_name, const xtd::ustring &description, const xtd::ustring &default_switch_value)
Initializes a new instance of the xtd::diagnostics::trace_switch class, using the specified display n...
trace_switch(const xtd::ustring &display_name, const xtd::ustring &description)
Initializes a new instance of the xtd::diagnostics::trace_switch class, using the specified display n...
bool trace_info() const
Gets a value indicating whether the switch allows informational messages.
void on_switch_setting_changed() override
Invoked when the switch_setting property is changed.
Represents text as a sequence of UTF-8 code units.
Definition: ustring.h:48
Contains xtd::diagnostics::debug class.
trace_level
Specifies what messages to output for the debug, trace and trace_switch classes.
Definition: trace_level.h:17
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition: system_report.h:17
Contains xtd::diagnostics::switch_base class.
Contains xtd::diagnostics::trace_level enum class.