xtd 0.2.0
default_trace_listener.h
Go to the documentation of this file.
1 #pragma once
5 #include "../core_export.h"
6 #include "trace_listener.h"
7 
9 namespace xtd {
11  namespace diagnostics {
31  public:
33 
55 
57 
75  bool assert_ui_enabled() const noexcept;
92  void assert_ui_enabled(bool assert_ui_enabled) noexcept;
93 
107  xtd::ustring log_file_name() const noexcept;
121  void log_file_name(const xtd::ustring log_file_name) noexcept;
123 
125 
127  void close() override;
128  void flush() override;
129 
131  void write(const xtd::ustring& message) override;
132 
134  void write_line(const xtd::ustring& message) override;
136 
137  private:
138  #if __XTD_CURRENT_TARGET_ID__ == __XTD_TARGET_ID_GUI_APPLICATION__
139  bool assert_ui_enabled_ = true;
140  #else
141  bool assert_ui_enabled_ = false;
142  #endif
143  xtd::ustring log_file_name_;
144  xtd::ustring message_line_;
145  };
146  }
147 }
Provides the abstract base class for the listeners who monitor trace and debug output.
Definition: trace_listener.h:35
void write(const object &o)
Writes the value of the object's ToString method to the listener you create when you implement the Tr...
Definition: trace_listener.h:260
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: system_report.h:17
Represents text as a sequence of UTF-8 code units.
Definition: ustring.h:46
Provides the default output methods and behavior for tracing.
Definition: default_trace_listener.h:30
void write_line(const object &o)
Writes the value of the object's ToString method to the listener you create when you implement the Tr...
Definition: trace_listener.h:283
Contains xtd::diagnostics::trace_listener listener.