DUNE-DAQ
DUNE Trigger and Data Acquisition software
Loading...
Searching...
No Matches
macro.hpp File Reference
Include dependency graph for macro.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define TRACE_LOG_FUNCTION   erstrace_user
 
#define TLOG(...)
 
#define ERS_DECLARE_ISSUE_BASE( namespace_name, class_name, base_class_name, message_, base_attributes, attributes)
 
#define ERS_DECLARE_ISSUE( namespace_name, class_name, message_, attributes)
 

Macro Definition Documentation

◆ ERS_DECLARE_ISSUE

#define ERS_DECLARE_ISSUE ( namespace_name,
class_name,
message_,
attributes )
Value:
__ERS_DECLARE_ISSUE_BASE__( namespace_name, class_name, ers::Issue, ERS_EMPTY message_, ERS_EMPTY, attributes ) \
__ERS_DEFINE_ISSUE_BASE__( inline, namespace_name, class_name, ers::Issue, ERS_EMPTY message_, ERS_EMPTY, attributes ) \
namespace namespace_name { \
static inline TraceStreamer& operator<<(TraceStreamer& x, const class_name &r) \
{if (x.do_m) {\
x.line_=r.context().line_number(); x.msg_append( r.message().c_str() );\
/* MAY NEED TO APPEND CHAINED ISSUE??? */ \
} \
if (x.do_s) { \
if (x.lvl_==TLVL_INFO) ers::info( r ); \
else if (x.lvl_==TLVL_LOG) ers::log( r ); \
else ers::debug( r, x.lvl_-TLVL_DEBUG ); \
x.do_s = 0; \
} \
return x; \
} \
}
std::ostream & operator<<(std::ostream &stream, const OksSystem::File &file)
Definition File.cpp:852
#define __ERS_DECLARE_ISSUE_BASE__(namespace_name, class_name, base_class_name, message, base_attributes, attributes)
#define ERS_EMPTY
Base class for any user define issue.
Definition Issue.hpp:69
void info(const Issue &issue)
Definition ers.hpp:95
void log(const Issue &issue)
Definition ers.hpp:102
void debug(const Issue &issue, int level=debug_level())
Definition ers.hpp:74

Definition at line 65 of file macro.hpp.

65# define ERS_DECLARE_ISSUE( namespace_name, class_name, message_, attributes ) \
66 __ERS_DECLARE_ISSUE_BASE__( namespace_name, class_name, ers::Issue, ERS_EMPTY message_, ERS_EMPTY, attributes ) \
67 __ERS_DEFINE_ISSUE_BASE__( inline, namespace_name, class_name, ers::Issue, ERS_EMPTY message_, ERS_EMPTY, attributes ) \
68 namespace namespace_name { \
69 static inline TraceStreamer& operator<<(TraceStreamer& x, const class_name &r) \
70 {if (x.do_m) {\
71 x.line_=r.context().line_number(); x.msg_append( r.message().c_str() );\
72 /* MAY NEED TO APPEND CHAINED ISSUE??? */ \
73 } \
74 if (x.do_s) { \
75 if (x.lvl_==TLVL_INFO) ers::info( r ); \
76 else if (x.lvl_==TLVL_LOG) ers::log( r ); \
77 else ers::debug( r, x.lvl_-TLVL_DEBUG ); \
78 x.do_s = 0; \
79 } \
80 return x; \
81 } \
82 }

◆ ERS_DECLARE_ISSUE_BASE

#define ERS_DECLARE_ISSUE_BASE ( namespace_name,
class_name,
base_class_name,
message_,
base_attributes,
attributes )
Value:
__ERS_DECLARE_ISSUE_BASE__( namespace_name, class_name, base_class_name, message_, base_attributes, attributes ) \
__ERS_DEFINE_ISSUE_BASE__( inline, namespace_name, class_name, base_class_name, message_, base_attributes, attributes ) \
namespace namespace_name { \
static inline TraceStreamer& operator<<(TraceStreamer& x, const class_name &r) \
{if (x.do_m) {\
x.line_=r.context().line_number(); x.msg_append( r.message().c_str() );\
/* MAY NEED TO APPEND CHAINED ISSUE??? */ \
} \
if (x.do_s) { \
if (x.lvl_==TLVL_INFO) ers::info( r ); \
else if (x.lvl_==TLVL_LOG) ers::log( r ); \
else ers::debug( r, x.lvl_-TLVL_DEBUG ); \
x.do_s = 0; \
} \
return x; \
} \
}

Definition at line 45 of file macro.hpp.

45# define ERS_DECLARE_ISSUE_BASE( namespace_name, class_name, base_class_name, message_, base_attributes, attributes ) \
46 __ERS_DECLARE_ISSUE_BASE__( namespace_name, class_name, base_class_name, message_, base_attributes, attributes ) \
47 __ERS_DEFINE_ISSUE_BASE__( inline, namespace_name, class_name, base_class_name, message_, base_attributes, attributes ) \
48 namespace namespace_name { \
49 static inline TraceStreamer& operator<<(TraceStreamer& x, const class_name &r) \
50 {if (x.do_m) {\
51 x.line_=r.context().line_number(); x.msg_append( r.message().c_str() );\
52 /* MAY NEED TO APPEND CHAINED ISSUE??? */ \
53 } \
54 if (x.do_s) { \
55 if (x.lvl_==TLVL_INFO) ers::info( r ); \
56 else if (x.lvl_==TLVL_LOG) ers::log( r ); \
57 else ers::debug( r, x.lvl_-TLVL_DEBUG ); \
58 x.do_s = 0; \
59 } \
60 return x; \
61 } \
62 }

◆ TLOG

#define TLOG ( ...)
Value:
TRACE_STREAMER(TLVL_LOG, \
_tlog_ARG2(not_used, CHOOSE_(__VA_ARGS__)(__VA_ARGS__) 0,need_at_least_one), \
_tlog_ARG3(not_used, CHOOSE_(__VA_ARGS__)(__VA_ARGS__) 0,"",need_at_least_one), \
1, 1)
#define _tlog_ARG2(a1, a2,...)
Definition Logger.hxx:275
#define _tlog_ARG3(a1, a2, a3,...)
Definition Logger.hxx:276
#define CHOOSE_(...)
Definition Logger.hxx:271

6 logging "streams" are defined: fatal, error, warning, info, log and debug. The first 4 are accessed via the ers:: methods with a TRACE destination added. THe last 2 are accessed via TRACE macros with an ers:: user method configured.

Definition at line 22 of file macro.hpp.

22# define TLOG(...) TRACE_STREAMER(TLVL_LOG, \
23 _tlog_ARG2(not_used, CHOOSE_(__VA_ARGS__)(__VA_ARGS__) 0,need_at_least_one), \
24 _tlog_ARG3(not_used, CHOOSE_(__VA_ARGS__)(__VA_ARGS__) 0,"",need_at_least_one), \
25 1, 1)

◆ TRACE_LOG_FUNCTION

#define TRACE_LOG_FUNCTION   erstrace_user

Definition at line 8 of file macro.hpp.