xtd - Reference Guide 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 {
29  public:
31 
53 
55 
73  bool assert_ui_enabled();
90  void assert_ui_enabled(bool assert_ui_enabled);
91 
105  xtd::ustring log_file_name() const;
119  void log_file_name(const xtd::ustring log_file_name);
121 
123 
125  void close() override;
126  void flush() override;
127 
129  void write(const xtd::ustring& message) override;
130 
132  void write_line(const xtd::ustring& message) override;
134 
135  private:
136  #if defined(__CMAKE_TARGET_TYPE__) && __CMAKE_TARGET_TYPE__ == 2 // 2 == GUI_APPLICATION
137  bool assert_ui_enabled_ = true;
138  #else
139  bool assert_ui_enabled_ = false;
140  #endif
141  xtd::ustring log_file_name_;
142  xtd::ustring message_line_;
143  };
144  }
145 }
Provides the abstract base class for the listeners who monitor trace and debug output.
Definition: trace_listener.h:33
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:258
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:50
Provides the default output methods and behavior for tracing.
Definition: default_trace_listener.h:28
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:281
Contains xtd::diagnostics::trace_listener listener.