DUNE-DAQ
DUNE Trigger and Data Acquisition software
Toggle main menu visibility
Loading...
Searching...
No Matches
dunedaq
sourcecode
ers
include
ers
ers.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/ers.h to include/ers/ers.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
/*
13
* ers.h
14
* ers
15
*
16
* Created by Matthias Wiesmann on 26.01.05.
17
* Modified by Serguei Kolos on 26.08.05.
18
* Copyright 2005 CERN. All rights reserved.
19
*
20
*/
21
27
28
#ifndef ERS_ERS_H
29
#define ERS_ERS_H
30
31
#include <
ers/Assertion.hpp
>
32
#include <
ers/Configuration.hpp
>
33
#include <
ers/Issue.hpp
>
34
#include <
ers/LocalStream.hpp
>
35
#include <
ers/Severity.hpp
>
36
#include <
ers/StreamManager.hpp
>
37
#include <functional>
38
#include <sstream>
39
#include <sys/resource.h>
40
41
#include <boost/preprocessor/facilities/is_empty.hpp>
42
#include <boost/preprocessor/logical/not.hpp>
43
#include <boost/preprocessor/punctuation/comma_if.hpp>
44
48
49
namespace
ers
{
50
typedef
Issue
Exception
;
51
56
70
inline
IssueCatcherHandler*
71
set_issue_catcher
(
const
std::function<
void
(
const
ers::Issue
&)>& catcher)
72
{
73
return
LocalStream::instance().set_issue_catcher(catcher);
74
}
75
79
inline
int
80
debug_level
()
81
{
82
return
Configuration::instance
().
debug_level
();
83
}
84
90
inline
void
91
debug
(
const
Issue
& issue,
int
level =
debug_level
())
92
{
93
StreamManager::instance
().
debug
(issue, level);
94
}
95
100
inline
void
101
error
(
const
Issue
& issue)
102
{
103
LocalStream::instance().error(issue);
104
}
105
110
inline
void
111
fatal
(
const
Issue
& issue)
112
{
113
LocalStream::instance().fatal(issue);
114
}
115
120
inline
void
121
info
(
const
Issue
& issue)
122
{
123
StreamManager::instance
().
information
(issue);
124
}
125
130
inline
void
131
log
(
const
Issue
& issue)
132
{
133
StreamManager::instance
().
log
(issue);
134
}
135
139
inline
int
140
verbosity_level
()
141
{
142
return
Configuration::instance
().
verbosity_level
();
143
}
144
149
inline
void
150
warning
(
const
Issue
& issue)
151
{
152
LocalStream::instance().warning(issue);
153
}
154
155
inline
int
156
enable_core_dump
()
157
{
158
rlimit core_limit = { RLIM_INFINITY, RLIM_INFINITY };
159
return
setrlimit(RLIMIT_CORE, &core_limit);
160
}
161
}
162
163
// ERS_DECLARE_ISSUE( ers, Message, ERS_EMPTY, ERS_EMPTY )
164
165
#define ERS_REPORT_IMPL(stream, issue, message, level) \
166
{ \
167
std::ostringstream ers_report_impl_out_buffer; \
168
ers_report_impl_out_buffer << message; \
169
stream(issue(ERS_HERE, ers_report_impl_out_buffer.str()) \
170
BOOST_PP_COMMA_IF(BOOST_PP_NOT(ERS_IS_EMPTY(ERS_EMPTY level))) level); \
171
}
172
173
#endif
// ERS_ERS_H
Assertion.hpp
Issue.hpp
LocalStream.hpp
Severity.hpp
StreamManager.hpp
ers::Configuration::verbosity_level
int verbosity_level() const
returns current verbosity level
Definition
Configuration.hpp:60
ers::Configuration::instance
static Configuration & instance()
return the singleton
Definition
Configuration.cpp:33
ers::Configuration::debug_level
int debug_level() const
returns current debug level
Definition
Configuration.hpp:58
ers::Issue
Base class for any user define issue.
Definition
Issue.hpp:76
ers::StreamManager::instance
static StreamManager & instance()
return the singleton
Definition
StreamManager.cpp:153
ers::StreamManager::log
void log(const Issue &issue)
sends an issue to the log stream
Definition
StreamManager.cpp:351
ers::StreamManager::debug
void debug(const Issue &issue, int level)
sends an Issue to the debug stream
Definition
StreamManager.cpp:311
ers::StreamManager::information
void information(const Issue &issue)
sends an issue to the information stream
Definition
StreamManager.cpp:342
Configuration.hpp
ers
Definition
Logger.hxx:231
ers::verbosity_level
int verbosity_level()
Definition
ers.hpp:140
ers::debug_level
int debug_level()
Definition
ers.hpp:80
ers::warning
void warning(const Issue &issue)
Definition
ers.hpp:150
ers::info
void info(const Issue &issue)
Definition
ers.hpp:121
ers::log
void log(const Issue &issue)
Definition
ers.hpp:131
ers::set_issue_catcher
IssueCatcherHandler * set_issue_catcher(const std::function< void(const ers::Issue &)> &catcher)
Definition
ers.hpp:71
ers::Exception
Issue Exception
Definition
ers.hpp:50
ers::debug
void debug(const Issue &issue, int level=debug_level())
Definition
ers.hpp:91
ers::fatal
void fatal(const Issue &issue)
Definition
ers.hpp:111
ers::enable_core_dump
int enable_core_dump()
Definition
ers.hpp:156
ers::error
void error(const Issue &issue)
Definition
ers.hpp:101
Generated on
for DUNE-DAQ by
1.18.0