xtd - Reference Guide  0.2.0
Modern c++17/20 framework to create console, GUI and unit test applications on Windows, macOS, Linux, iOS and android.
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 {
24  public:
44 
61  bool assert_ui_enabled();
78  void assert_ui_enabled(bool assert_ui_enabled);
79 
93  xtd::ustring log_file_name() const;
107  void log_file_name(const xtd::ustring log_file_name);
108 
109  void close() override;
110  void flush() override;
111 
113  void write(const xtd::ustring& message) override;
114 
116  void write_line(const xtd::ustring& message) override;
117 
118  private:
119 #if defined(__CMAKE_TARGET_TYPE__) && __CMAKE_TARGET_TYPE__ == 2 // 2 == GUI_APPLICATION
120  bool assert_ui_enabled_ = true;
121 #else
122  bool assert_ui_enabled_ = false;
123 #endif
124  xtd::ustring log_file_name_;
125  xtd::ustring message_line_;
126  };
127  }
128 }
Provides the abstract base class for the listeners who monitor trace and debug output.
Definition: trace_listener.h:28
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:242
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:48
Provides the default output methods and behavior for tracing.
Definition: default_trace_listener.h:23
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:265
Contains xtd::diagnostics::trace_listener listener.