xtd 0.2.0
Loading...
Searching...
No Matches
default_trace_listener.hpp
Go to the documentation of this file.
1
4#pragma once
5#include "../core_export.hpp"
6#include "../target_id.hpp"
7#include "trace_listener.hpp"
8
10namespace xtd {
12 namespace diagnostics {
34 public:
36
61
63
81 bool assert_ui_enabled() const noexcept;
99
113 xtd::string log_file_name() const noexcept;
127 void log_file_name(const xtd::string log_file_name) noexcept;
129
131
133 void close() override;
134 void flush() override;
135
137 void write(const xtd::string& message) override;
138
140 void write_line(const xtd::string& message) override;
142
143 private:
144 bool assert_ui_enabled_ = true;
145 xtd::string log_file_name_;
146 xtd::string message_line_;
147 };
148 }
149}
void close() override
When overridden in a derived class, closes the output stream so it no longer receives tracing or debu...
void flush() override
When overridden in a derived class, flushes the output buffer.
void write_line(const xtd::string &message) override
Writes the message to the listener you create when you implement the trace_listener class followed by...
default_trace_listener(const xtd::string log_file_name)
Initializes a new instance of the default_trace_listener class with "default" as its xtd::diagnostics...
bool assert_ui_enabled() const noexcept
Gets a value indicating whether the application is running in user-interface mode.
void write(const xtd::string &message) override
Writes the message to the listener you create when you implement the trace_listener class.
default_trace_listener()
Initializes a new instance of the default_trace_listener class with "default" as its xtd::diagnostics...
xtd::string log_file_name() const noexcept
Gets the name of a log file to write trace or debug messages to.
Provides the abstract base class for the listeners who monitor trace and debug output.
Definition trace_listener.hpp:42
trace_listener()=default
Initializes a new instance of the trace_listener class.
Contains core_export_ keyword.
#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
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::target_id enum class.
Contains xtd::diagnostics::trace_listener listener.