7#include "../abstract.h"
16 namespace diagnostics {
73 void indent_level(
uint32 indent_level) noexcept;
83 void indent_size(
uint32 indent_size) noexcept;
88 virtual
bool is_thread_safe() const noexcept;
93 const
xtd::
string& name() const noexcept;
98 void name(const
xtd::
string& name) noexcept;
124 virtual
void close();
129 virtual
void fail(const
xtd::
string& message) {
130 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
140 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
156 template<
typename object>
158 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
160 write_event_cache(event_cache);
172 template<
typename object>
174 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
176 write_event_cache(event_cache);
188 template<
typename ...objects>
190 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
192 write_event_cache(event_cache);
204 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
206 write_event_cache(event_cache);
219 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
221 write_event_cache(event_cache);
234 template<
typename ...objects>
236 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
238 write_event_cache(event_cache);
251 template<
typename activity_
id_type>
253 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
254 write_line(
xtd::string::format(
"{} transfer: {} : {}, related_activity_id={}", source,
id, message, related_activity_id));
255 write_event_cache(event_cache);
261 template <
typename object>
263 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
271 template <
typename object>
273 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
284 template <
typename object>
286 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
294 template <
typename object>
296 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
307 template<
typename object>
309 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
325 void need_indent(
bool need_indent) noexcept;
329 void thread_safe(
bool thread_safe) noexcept;
337 virtual
void write_indent() {
338 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE)
339 need_indent_ =
false;
340 for (
uint32 i = 0;
i < indent_level_; ++
i)
351 bool is_thread_safe_ =
false;
353 bool need_indent_ =
true;
Represents text as a sequence of character units.
Definition basic_string.h:79
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.h:2296
Provides trace event data specific to a thread and a process.
Definition trace_event_cache.h:30
Provides the abstract base class for the listeners who monitor trace and debug output.
Definition trace_listener.h:37
virtual void flush()
When overridden in a derived class, flushes the output buffer.
Definition trace_listener.h:146
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 std::vector< object > &data)
Writes trace information, a data object and event information to the listener specific output.
Definition trace_listener.h:173
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.h:203
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.h:157
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.h:218
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.h:235
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.h:272
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 objects &... data)
Writes trace information, an array of data objects and event information to the listener specific out...
Definition trace_listener.h:189
virtual void fail(const xtd::string &message, const xtd::string &detail_message)
Emits the specified error message.
Definition trace_listener.h:139
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:285
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.h:262
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.h:252
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.h:295
trace_options
Specifies trace data options to be written to the trace output.
Definition trace_options.h:25
#define abstract_
This keyword is used to represents an abstract class.
Definition abstract.h:25
#define core_export_
Define shared library export.
Definition core_export.h:13
int32_t int32
Represents a 32-bit signed integer.
Definition int32.h:23
uint32_t uint32
Represents a 32-bit unsigned integer.
Definition uint32.h:23
trace_event_type
Identifies the type of event that has caused the trace.
Definition trace_event_type.h:25
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition xtd_about_box.h:10
Contains xtd::diagnostics::trace_event_cache class.
Contains xtd::diagnostics::trace_event_type enum class.
Contains xtd::diagnostics::trace_options enum class.