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 <sys/resource.h>
32
#include <functional>
33
#include <sstream>
34
#include <
ers/StreamManager.hpp
>
35
#include <
ers/Configuration.hpp
>
36
#include <
ers/Issue.hpp
>
37
#include <
ers/Assertion.hpp
>
38
#include <
ers/Severity.hpp
>
39
#include <
ers/LocalStream.hpp
>
40
41
#include <boost/preprocessor/logical/not.hpp>
42
#include <boost/preprocessor/punctuation/comma_if.hpp>
43
#include <boost/preprocessor/facilities/is_empty.hpp>
44
48
49
namespace
ers
50
{
51
typedef
Issue
Exception
;
52
57
70
inline
IssueCatcherHandler *
71
set_issue_catcher
(
const
std::function<
void
(
const
ers::Issue
& )> & catcher )
72
{
return
LocalStream::instance().set_issue_catcher( catcher ); }
73
77
inline
int
debug_level
( )
78
{
return
Configuration::instance
().
debug_level
( ); }
79
85
inline
void
debug
(
const
Issue
& issue,
int
level =
debug_level
() )
86
{
StreamManager::instance
().
debug
( issue, level ); }
87
92
inline
void
error
(
const
Issue
& issue )
93
{ LocalStream::instance().error( issue ); }
94
99
inline
void
fatal
(
const
Issue
& issue )
100
{ LocalStream::instance().fatal( issue ); }
101
106
inline
void
info
(
const
Issue
& issue )
107
{
StreamManager::instance
().
information
( issue ); }
108
113
inline
void
log
(
const
Issue
& issue )
114
{
StreamManager::instance
().
log
( issue ); }
115
119
inline
int
verbosity_level
( )
120
{
return
Configuration::instance
().
verbosity_level
( ); }
121
126
inline
void
warning
(
const
Issue
& issue )
127
{ LocalStream::instance().warning( issue ); }
128
129
inline
int
enable_core_dump
() {
130
rlimit core_limit = { RLIM_INFINITY, RLIM_INFINITY };
131
return
setrlimit( RLIMIT_CORE, &core_limit );
132
}
133
}
134
135
// ERS_DECLARE_ISSUE( ers, Message, ERS_EMPTY, ERS_EMPTY )
136
137
#define ERS_REPORT_IMPL( stream, issue, message, level ) \
138
{ \
139
std::ostringstream ers_report_impl_out_buffer; \
140
ers_report_impl_out_buffer << message; \
141
stream( issue( ERS_HERE, ers_report_impl_out_buffer.str() ) \
142
BOOST_PP_COMMA_IF( BOOST_PP_NOT( ERS_IS_EMPTY( ERS_EMPTY level ) ) ) level ); \
143
}
144
145
#endif
// ERS_ERS_H
146
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:61
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:80
ers::StreamManager::instance
static StreamManager & instance()
return the singleton
Definition
StreamManager.cpp:162
ers::StreamManager::log
void log(const Issue &issue)
sends an issue to the log stream
Definition
StreamManager.cpp:378
ers::StreamManager::debug
void debug(const Issue &issue, int level)
sends an Issue to the debug stream
Definition
StreamManager.cpp:337
ers::StreamManager::information
void information(const Issue &issue)
sends an issue to the information stream
Definition
StreamManager.cpp:369
Configuration.hpp
ers
Definition
Logger.hxx:202
ers::verbosity_level
int verbosity_level()
Definition
ers.hpp:119
ers::debug_level
int debug_level()
Definition
ers.hpp:77
ers::warning
void warning(const Issue &issue)
Definition
ers.hpp:126
ers::info
void info(const Issue &issue)
Definition
ers.hpp:106
ers::log
void log(const Issue &issue)
Definition
ers.hpp:113
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:51
ers::debug
void debug(const Issue &issue, int level=debug_level())
Definition
ers.hpp:85
ers::fatal
void fatal(const Issue &issue)
Definition
ers.hpp:99
ers::enable_core_dump
int enable_core_dump()
Definition
ers.hpp:129
error
Factory couldn t std::string alg_name Invalid configuration error
Definition
Issues.hpp:34
Generated on
for DUNE-DAQ by
1.17.0