DUNE-DAQ
DUNE Trigger and Data Acquisition software
Toggle main menu visibility
Loading...
Searching...
No Matches
dunedaq
sourcecode
ers
include
ers
internal
macro.hpp
Go to the documentation of this file.
1
/*
2
* DUNE DAQ modification notice:
3
* This file has been modified from the original ATLAS ers source for the DUNE DAQ project.
4
* Fork baseline commit: 8267df82a4f6fe6bf02c4014923eba19eddc4614 (2020-04-14).
5
* Renamed since fork: yes (from ers/internal/macro.h to include/ers/internal/macro.hpp).
6
*
7
* Original copyright:
8
* Copyright (C) 2001-2020 CERN for the benefit of the ATLAS collaboration.
9
* Licensed under the Apache License, Version 2.0.
10
*/
11
12
#ifndef ERS_MACRO_H
13
#define ERS_MACRO_H
14
19
20
#include <boost/preprocessor/cat.hpp>
21
#include <
ers/StandardStreamOutput.hpp
>
22
#include <
ers/StreamFactory.hpp
>
23
#include <
ers/ers.hpp
>
24
25
ERS_DECLARE_ISSUE
(
ers
, InternalMessage,
ERS_EMPTY
,
ERS_EMPTY
)
26
27
#define ERS_REGISTER_OUTPUT_STREAM(class, name, param) \
28
namespace { \
29
struct BOOST_PP_CAT(OutputStreamRegistrator, __LINE__) \
30
{ \
31
static ers::OutputStream* create(const std::string& param) \
32
{ \
33
return new class(param); \
34
} \
35
BOOST_PP_CAT(OutputStreamRegistrator, __LINE__)() \
36
{ \
37
ers::StreamFactory::instance().register_out_stream(name, create); \
38
} \
39
} BOOST_PP_CAT(registrator, __LINE__); \
40
}
41
42
#define ERS_INTERNAL_DEBUG(level, message) \
43
{ \
44
if (ers::debug_level() >= level) { \
45
std::ostringstream out; \
46
out << message; \
47
ers::InternalMessage info(ERS_HERE, out.str()); \
48
info.set_severity(ers::Severity(ers::Debug, level)); \
49
ers::StandardStreamOutput::println(std::cout, info, 0); \
50
} \
51
}
52
53
#define ERS_INTERNAL_INFO(message) \
54
{ \
55
std::ostringstream out; \
56
out << message; \
57
ers::InternalMessage info(ERS_HERE, out.str()); \
58
info.set_severity(ers::Information); \
59
ers::StandardStreamOutput::println(std::cout, info, 0); \
60
}
61
62
#define ERS_INTERNAL_WARNING(message) \
63
{ \
64
std::ostringstream out; \
65
out << message; \
66
ers::InternalMessage info(ERS_HERE, out.str()); \
67
info.set_severity(ers::Warning); \
68
ers::StandardStreamOutput::println(std::cerr, info, 0); \
69
}
70
71
#define ERS_INTERNAL_ERROR(message) \
72
{ \
73
std::ostringstream out; \
74
out << message; \
75
ers::InternalMessage info(ERS_HERE, out.str()); \
76
info.set_severity(ers::Error); \
77
ers::StandardStreamOutput::println(std::cerr, info, 0); \
78
}
79
80
#define ERS_INTERNAL_FATAL(message) \
81
{ \
82
std::ostringstream out; \
83
out << message; \
84
ers::InternalMessage info(ERS_HERE, out.str()); \
85
info.set_severity(ers::Fatal); \
86
ers::StandardStreamOutput::println(std::cerr, info, 0); \
87
::exit(13); \
88
}
89
90
#endif
ERS_EMPTY
#define ERS_EMPTY
Definition
IssueDeclarationMacro.hpp:23
StandardStreamOutput.hpp
StreamFactory.hpp
ers.hpp
ERS_DECLARE_ISSUE
#define ERS_DECLARE_ISSUE(namespace_name, class_name, message_, attributes)
Definition
macro.hpp:71
ers
Definition
Logger.hxx:231
Generated on
for DUNE-DAQ by
1.18.0