7 #include "../abstract.h" 8 #include "../ustring.h" 16 namespace diagnostics {
66 uint32 indent_level()
const noexcept;
71 void indent_level(
uint32 indent_level) noexcept;
76 uint32 indent_size()
const noexcept;
81 void indent_size(
uint32 indent_size) noexcept;
86 virtual bool is_thread_safe()
const noexcept;
114 void trace_output_options(
trace_options trace_output_options) noexcept;
122 virtual void close();
128 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE) 138 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE) 154 template<
typename object>
156 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE) 158 write_event_cache(event_cache);
170 template<
typename object>
172 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE) 174 write_event_cache(event_cache);
186 template<
typename ...objects>
188 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE) 190 write_event_cache(event_cache);
202 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE) 204 write_event_cache(event_cache);
217 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE) 219 write_event_cache(event_cache);
232 template<
typename ...objects>
234 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE) 236 write_event_cache(event_cache);
249 template<
typename activity_
id_type>
251 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE) 252 write_line(
xtd::ustring::format(
"{} transfer: {} : {}, related_activity_id={}", source,
id, message, related_activity_id));
253 write_event_cache(event_cache);
259 template <
typename object>
261 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE) 269 template <
typename object>
271 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE) 282 template <
typename object>
284 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE) 292 template <
typename object>
294 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE) 301 virtual void write_line(
const xtd::ustring& message) = 0;
305 template<
typename object>
307 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE) 320 bool need_indent()
const noexcept;
323 void need_indent(
bool need_indent) noexcept;
327 void thread_safe(
bool thread_safe) noexcept;
336 #if !defined(NDEBUG) || defined(DEBUG) || defined(TRACE) 337 need_indent_ =
false;
338 for (
uint32 i = 0;
i < indent_level_; ++
i)
349 bool is_thread_safe_ =
false;
351 bool need_indent_ =
true;
Provides the abstract base class for the listeners who monitor trace and debug output.
Definition: trace_listener.h:35
void trace_event(const xtd::diagnostics::trace_event_cache &event_cache, const xtd::ustring &source, const xtd::diagnostics::trace_event_type &event_type, int32 id, const xtd::ustring &format, const objects &... args)
Writes trace information, a formatted array of objects and event information to the listener specific...
Definition: trace_listener.h:233
void trace_data(const xtd::diagnostics::trace_event_cache &event_cache, const xtd::ustring &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:171
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:260
void write(const object &o, const xtd::ustring &category)
Writes a category name and the value of the object's ToString method to the listener you create when ...
Definition: trace_listener.h:270
The xtd namespace contains all fundamental classes to access Hardware, Os, System, and more.
Definition: system_report.h:17
virtual void fail(const xtd::ustring &message, const xtd::ustring &detail_message)
Emits the specified error message.
Definition: trace_listener.h:137
Provides trace event data specific to a thread and a process.
Definition: trace_event_cache.h:28
virtual void trace_event(const xtd::diagnostics::trace_event_cache &event_cache, const xtd::ustring &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:201
Represents text as a sequence of UTF-8 code units.
Definition: ustring.h:46
trace_options
Specifies trace data options to be written to the trace output.
Definition: trace_options.h:23
Contains xtd::diagnostics::trace_event_type enum class.
virtual void write_indent()
Writes the indent to the listener you create when you implement this class, and resets the NeedIndent...
Definition: trace_listener.h:335
Contains xtd::diagnostics::trace_options enum class.
void trace_transfer(const xtd::diagnostics::trace_event_cache &event_cache, const xtd::ustring &source, int32 id, const xtd::ustring &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:250
void write_line(const object &o, const xtd::ustring &category)
Writes a category name and the value of the object's ToString method to the listener you create when ...
Definition: trace_listener.h:293
void trace_data(const xtd::diagnostics::trace_event_cache &event_cache, const xtd::ustring &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:155
int_least32_t int32
Represents a 32-bit signed integer.
Definition: types.h:129
#define abstract_
This keyword is used to represents an abstract class.
Definition: abstract.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:283
virtual void trace_event(const xtd::diagnostics::trace_event_cache &event_cache, const xtd::ustring &source, const xtd::diagnostics::trace_event_type &event_type, int32 id, const xtd::ustring &message)
Writes trace information, a message, and event information to the listener specific output...
Definition: trace_listener.h:216
virtual void flush()
When overridden in a derived class, flushes the output buffer.
Definition: trace_listener.h:144
Do not write any elements.
Contains xtd::diagnostics::trace_event_cache class.
uint_least32_t uint32
Represents a 32-bit unsigned integer.
Definition: types.h:239
virtual void fail(const xtd::ustring &message)
Emits an error message to the listener you create when you implement the TraceListener class...
Definition: trace_listener.h:127
static ustring join(const ustring separator, const collection_t &values) noexcept
Concatenates a specified separator string between each element of a specified object array...
Definition: ustring.h:932
void trace_data(const xtd::diagnostics::trace_event_cache &event_cache, const xtd::ustring &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:187
trace_event_type
Identifies the type of event that has caused the trace.
Definition: trace_event_type.h:23