7#include "../abstract.hpp"
9#include "../string.hpp"
17 namespace diagnostics {
74 void indent_level(
uint32 indent_level) noexcept;
84 void indent_size(
uint32 indent_size) noexcept;
89 virtual
bool is_thread_safe() const noexcept;
94 const
xtd::
string& name() const noexcept;
99 void name(const
xtd::
string& name) noexcept;
125 virtual
void close();
130 virtual
void fail(const
xtd::
string& message) {
131 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
141 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
157 template<
class objelassct>
159 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
161 write_event_cache(event_cache);
173 template<
class objelassct>
175 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
177 write_event_cache(event_cache);
189 template<
class ...objects>
191 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
193 write_event_cache(event_cache);
205 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
207 write_event_cache(event_cache);
220 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
222 write_event_cache(event_cache);
235 template<
class ...objects>
237 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
239 write_event_cache(event_cache);
252 template<
class activity_
id_type>
254 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
255 write_line(
xtd::string::format(
"{} transfer: {} : {}, related_activity_id={}", source,
id, message, related_activity_id));
256 write_event_cache(event_cache);
262 template <
class object>
264 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
272 template <
class object>
274 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
285 template <
class object>
287 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
295 template <
class object>
297 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
308 template <
class object>
310 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
326 void need_indent(
bool need_indent) noexcept;
330 void thread_safe(
bool thread_safe) noexcept;
338 virtual
void write_indent() {
339 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
340 need_indent_ =
false;
341 for (
uint32 i = 0;
i < indent_level_; ++
i)
352 bool is_thread_safe_ =
false;
354 bool need_indent_ =
true;
Provides methods for creating, manipulating, searching, and sorting arrays, thereby serving as the ba...
Definition array.hpp:61
Represents text as a sequence of character units.
Definition basic_string.hpp:71
static basic_string join(const basic_string separator, const collection_t &values) noexcept
Concatenates a specified separator basic_string between each element of a specified object array,...
Definition basic_string.hpp:2288
Provides trace event data specific to a thread and a process.
Definition trace_event_cache.hpp:29
Provides the abstract base class for the listeners who monitor trace and debug output.
Definition trace_listener.hpp:38
virtual void flush()
When overridden in a derived class, flushes the output buffer.
Definition trace_listener.hpp:147
virtual void trace_event(const xtd::diagnostics::trace_event_cache &event_cache, const xtd::string &source, const xtd::diagnostics::trace_event_type &event_type, int32 id)
Writes trace and event information to the listener specific output.
Definition trace_listener.hpp:204
void trace_data(const xtd::diagnostics::trace_event_cache &event_cache, const xtd::string &source, const xtd::diagnostics::trace_event_type &event_type, int32 id, const object &data)
Writes trace information, a data object and event information to the listener specific output.
Definition trace_listener.hpp:158
virtual void trace_event(const xtd::diagnostics::trace_event_cache &event_cache, const xtd::string &source, const xtd::diagnostics::trace_event_type &event_type, int32 id, const xtd::string &message)
Writes trace information, a message, and event information to the listener specific output.
Definition trace_listener.hpp:219
void trace_event(const xtd::diagnostics::trace_event_cache &event_cache, const xtd::string &source, const xtd::diagnostics::trace_event_type &event_type, int32 id, const xtd::string &format, const objects &... args)
Writes trace information, a formatted array of objects and event information to the listener specific...
Definition trace_listener.hpp:236
trace_listener(const xtd::string &name)
Initializes a new instance of the trace_listener class using the specified name as the listener.
bool need_indent() const noexcept
Gets a value indicating whether to indent the output.
virtual void write(const xtd::string &message)=0
Writes the message to the listener you create when you implement the trace_listener class.
trace_listener()=default
Initializes a new instance of the trace_listener class.
void write(const object &o, const xtd::string &category)
Writes a category name and the value of the object's ToString method to the listener you create when ...
Definition trace_listener.hpp:273
void trace_data(const xtd::diagnostics::trace_event_cache &event_cache, const xtd::string &source, const xtd::diagnostics::trace_event_type &event_type, int32 id, objects &&... data)
Writes trace information, an array of data objects and event information to the listener specific out...
Definition trace_listener.hpp:190
virtual void fail(const xtd::string &message, const xtd::string &detail_message)
Emits the specified error message.
Definition trace_listener.hpp:140
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.hpp:286
virtual void write_line(const xtd::string &message)=0
Writes the message to the listener you create when you implement the trace_listener class followed by...
uint32 indent_level() const noexcept
Gets the indent level.
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.hpp:263
void trace_transfer(const xtd::diagnostics::trace_event_cache &event_cache, const xtd::string &source, int32 id, const xtd::string &message, const activity_id_type &related_activity_id)
Writes trace information, a message, a related activity identity and event information to the listene...
Definition trace_listener.hpp:253
void trace_data(const xtd::diagnostics::trace_event_cache &event_cache, const xtd::string &source, const xtd::diagnostics::trace_event_type &event_type, int32 id, const xtd::array< object > &data)
Writes trace information, a data object and event information to the listener specific output.
Definition trace_listener.hpp:174
void write_line(const object &o, const xtd::string &category)
Writes a category name and the value of the object's ToString method to the listener you create when ...
Definition trace_listener.hpp:296
trace_options
Specifies trace data options to be written to the trace output.
Definition trace_options.hpp:25
#define abstract_
This keyword is used to represents an abstract class.
Definition abstract.hpp:25
#define core_export_
Define shared library export.
Definition core_export.hpp:13
int32_t int32
Represents a 32-bit signed integer.
Definition int32.hpp:23
uint32_t uint32
Represents a 32-bit unsigned integer.
Definition uint32.hpp:23
trace_event_type
Identifies the type of event that has caused the trace.
Definition trace_event_type.hpp:25
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.hpp:10
Contains xtd::diagnostics::trace_event_cache class.
Contains xtd::diagnostics::trace_event_type enum class.
Contains xtd::diagnostics::trace_options enum class.