xtd - Reference Guide  0.1.1
Modern c++17/20 framework to create console, GUI and unit test applications on Windows, macOS, Linux, iOS and android.
trace_filter.h
Go to the documentation of this file.
1 #pragma once
5 #include <any>
6 #include <map>
7 #include <vector>
8 #include "../object.h"
9 #include "../ustring.h"
10 #include "default_trace_listener.h"
11 #include "source_levels.h"
12 #include "source_switch.h"
14 
16 namespace xtd {
18  namespace diagnostics {
27  class trace_filter : public object {
28  public:
37  virtual bool should_trace(const xtd::diagnostics::trace_event_cache& cache, const xtd::ustring& source, xtd::diagnostics::trace_event_type event_type, int32_t id, const xtd::ustring& message, std::any data1, const std::vector<std::any>& data_array) = 0;
38 
39  protected:
41  trace_filter() = default;
42 
49  bool should_trace(const xtd::diagnostics::trace_event_cache& cache, const xtd::ustring& source, xtd::diagnostics::trace_event_type event_type, int32_t id, const xtd::ustring& message);
57  bool should_trace(const xtd::diagnostics::trace_event_cache& cache, const xtd::ustring& source, xtd::diagnostics::trace_event_type event_type, int32_t id, const xtd::ustring& message, std::any data1);
58  };
59  }
60 }
Provides trace event data specific to a thread and a process.
Definition: trace_event_cache.h:22
Provides the base class for trace filter implementations.
Definition: trace_filter.h:27
bool should_trace(const xtd::diagnostics::trace_event_cache &cache, const xtd::ustring &source, xtd::diagnostics::trace_event_type event_type, int32_t id, const xtd::ustring &message)
determines whether the trace listener should trace the event.
virtual bool should_trace(const xtd::diagnostics::trace_event_cache &cache, const xtd::ustring &source, xtd::diagnostics::trace_event_type event_type, int32_t id, const xtd::ustring &message, std::any data1, const std::vector< std::any > &data_array)=0
When overridden in a derived class, determines whether the trace listener should trace the event.
bool should_trace(const xtd::diagnostics::trace_event_cache &cache, const xtd::ustring &source, xtd::diagnostics::trace_event_type event_type, int32_t id, const xtd::ustring &message, std::any data1)
determines whether the trace listener should trace the event.
trace_filter()=default
Initializes a new instance of the trace_filter class.
Supports all classes in the xtd class hierarchy and provides low-level services to derived classes....
Definition: object.h:26
Represents text as a sequence of UTF-8 code units.
Definition: ustring.h:48
Contains xtd::diagnostics::default_trace_listener class.
trace_event_type
Identifies the type of event that has caused the trace.
Definition: trace_event_type.h:18
The xtd namespace contains all fundamental classes to access Hardware, Os, System,...
Definition: system_report.h:17
Contains xtd::diagnostics::source_levels enum class.
Contains xtd::diagnostics::source_switch class.
Contains xtd::diagnostics::trace_listener_collection class.