10 #ifndef _STRUS_DEBUG_TRACE_INTERFACE_HPP_INCLUDED
11 #define _STRUS_DEBUG_TRACE_INTERFACE_HPP_INCLUDED
27 :m_type(type_),m_component(component_),m_id(id_),m_content(content_){}
29 :m_type(o.m_type),m_component(o.m_component),m_id(o.m_id),m_content(o.m_content){}
33 static const char* ar[] = {
"open",
"close",
"event"};
39 const char*
id()
const {
return m_id;}
40 const std::string&
content()
const {
return m_content;}
46 const char* m_component;
48 std::string m_content;
63 virtual void open(
const char* type,
const std::string& name=std::string())=0;
66 virtual void close()=0;
72 virtual void event(
const char* eventid,
const char* format, ...)
74 __attribute__ ((format (printf, 3, 4)))
96 virtual bool enable(
const std::string& component)=0;
100 virtual void disable(
const std::string& component)=0;
120 virtual std::vector<DebugTraceMessage>
fetchMessages()
const=0;
virtual void releaseContext()=0
Dellocate context for current thread.
virtual bool enable(const std::string &component)=0
Enable debugging for a component adressed by name.
virtual void allocContext()=0
Allocate context for current thread.
const char * id() const
Definition: debugTraceInterface.hpp:39
Definition: debugTraceInterface.hpp:24
virtual void event(const char *eventid, const char *format,...)=0
Report an event.
virtual void disable(const std::string &component)=0
Disable debugging for a component adressed by name if enabled before.
Managing interface for reporting debug trace messages in a uniform way.
Definition: debugTraceInterface.hpp:81
virtual void open(const char *type, const std::string &name=std::string())=0
Hierarchical open of a scope of events.
virtual std::vector< DebugTraceMessage > fetchMessages() const =0
Get and clear all messages of the current thread an clears the error flag.
DebugTraceMessage(const DebugTraceMessage &o)
Definition: debugTraceInterface.hpp:28
const std::string & content() const
Definition: debugTraceInterface.hpp:40
const char * typeName() const
Definition: debugTraceInterface.hpp:42
Type type() const
Definition: debugTraceInterface.hpp:37
virtual void close()=0
Close of the current scope.
One item of a debug trace.
Definition: debugTraceInterface.hpp:22
virtual bool hasError() const =0
Test if an error occurred in the trace.
virtual bool setMaxNofThreads(unsigned int maxNofThreads)=0
Redefine the maximum number of threads using the debug trace.
Definition: debugTraceInterface.hpp:24
Structured error codes for strus components.
virtual DebugTraceContextInterface * createTraceContext(const char *component) const =0
Get the context for a component addressed by name if enabled for the current thread.
Interface for reporting debug trace messages in a uniform way.
Definition: debugTraceInterface.hpp:53
Definition: debugTraceInterface.hpp:24
virtual ~DebugTraceContextInterface()
Destructor.
Definition: debugTraceInterface.hpp:57
Type
Definition: debugTraceInterface.hpp:24
virtual ~DebugTraceInterface()
Destructor.
Definition: debugTraceInterface.hpp:85
DebugTraceMessage(Type type_, const char *component_, const char *id_, const std::string &content_)
Definition: debugTraceInterface.hpp:26
const char * component() const
Definition: debugTraceInterface.hpp:38
static const char * typeName(Type tp)
Definition: debugTraceInterface.hpp:31