ErrorReporting.h File Reference
#include <atomic>
#include <condition_variable>
#include <filesystem>
#include <fstream>
#include <map>
#include <memory>
#include <mutex>
#include <optional>
#include <thread>
#include <ArmarXCore/core/logging/Logging.h>
#include <ArmarXCore/core/util/PropagateConst.h>
#include "SlaveIdentifier.h"

Classes

class  Entry
 Brief description of class Entry. More...
 
class  Reporter
 Brief description of class Reporter. More...
 
class  Reporting
 Brief description of class Reporting. More...
 

Namespaces

namespace  armarx
 This file offers overloads of toIce() and fromIce() functions for STL container types.
 
namespace  armarx::control
 
namespace  armarx::control::ethercat
 
namespace  armarx::control::ethercat::reporting
 

Macros

#define _detail_BUS_REPORT_CONSTRUCTION(bin, ...)
 
#define _detail_DEVICE_REPORT_CONSTRUCTION(devName, ...)
 
#define _detail_GENERAL_REPORT_CONSTRUCTION(...)
 
#define _detail_SLAVE_REPORT_CONSTRUCTION(_sid, ...)
 
#define BUS_DEBUG(bin, ...)
 
#define BUS_ERROR(bin, ...)
 
#define BUS_ERROR_LOCAL(reporter, bin, ...)
 
#define BUS_FATAL_AND_THROW(bin, ...)
 
#define BUS_INFO(bin, ...)
 
#define BUS_WARNING(bin, ...)
 
#define BUS_WARNING_LOCAL(reporter, bin, ...)
 
#define DEVICE_ERROR(deviceName, ...)
 
#define DEVICE_ERROR_LOCAL(reporter, deviceName, ...)
 
#define DEVICE_FATAL_AND_THROW(deviceName, ...)
 
#define DEVICE_INFO(deviceName, ...)
 
#define DEVICE_WARNING(deviceName, ...)
 
#define DEVICE_WARNING_LOCAL(reporter, deviceName, ...)
 
#define GENERAL_DEBUG(...)
 
#define GENERAL_ERROR(...)
 
#define GENERAL_INFO(...)
 
#define GENERAL_WARNING(...)
 
#define SLAVE_DEBUG(sid, ...)
 
#define SLAVE_ERROR(sid, ...)
 
#define SLAVE_ERROR_LOCAL(reporter, sid, ...)
 
#define SLAVE_FATAL_AND_THROW(sid, ...)
 
#define SLAVE_INFO(sid, ...)
 
#define SLAVE_WARNING(sid, ...)
 
#define SLAVE_WARNING_LOCAL(reporter, sid, ...)
 

Typedefs

using Reporting = reporting::Reporting
 
using ReportingEntry = reporting::Entry
 
using ReportingType = reporting::Type
 

Enumerations

enum class  Severity {
  Debug , Info , Warning , Error ,
  Fatal
}
 The Severity enum. More...
 
enum class  Type { Bus , Slave , Device , General }
 The Type enum. More...
 

Functions

std::ostream & operator<< (std::ostream &stream, const Severity &rhs)
 
std::ostream & operator<< (std::ostream &stream, const Type &rhs)
 

Macro Definition Documentation

◆ _detail_BUS_REPORT_CONSTRUCTION

#define _detail_BUS_REPORT_CONSTRUCTION ( bin,
... )
Value:
.errorType(armarx::control::ethercat::ReportingType::Bus) \
.metaInfo(__FILE__, __LINE__, ARMARX_FUNCTION) \
.message(__VA_ARGS__) \
#define ARMARX_FUNCTION
Definition Logging.h:120
Entry & message(const char *fmt, T... args)
Definition ErrorReporting.h:110
Entry & busIterationNumber(std::uint64_t iteration)
Definition ErrorReporting.cpp:396
Entry & metaInfo(const char *file, int line, const char *function)
Definition ErrorReporting.cpp:343
Entry & errorType(Type type)
Definition ErrorReporting.cpp:336
reporting::Entry ReportingEntry
Definition ErrorReporting.h:267

◆ _detail_DEVICE_REPORT_CONSTRUCTION

#define _detail_DEVICE_REPORT_CONSTRUCTION ( devName,
... )
Value:
.errorType(armarx::control::ethercat::ReportingType::Device) \
.metaInfo(__FILE__, __LINE__, ARMARX_FUNCTION) \
.message(__VA_ARGS__) \
.deviceName(devName)
Entry & deviceName(const char *deviceName)
Definition ErrorReporting.cpp:352

◆ _detail_GENERAL_REPORT_CONSTRUCTION

#define _detail_GENERAL_REPORT_CONSTRUCTION ( ...)
Value:
.errorType(armarx::control::ethercat::ReportingType::General) \
.metaInfo(__FILE__, __LINE__, ARMARX_FUNCTION) \
.message(__VA_ARGS__)

◆ _detail_SLAVE_REPORT_CONSTRUCTION

#define _detail_SLAVE_REPORT_CONSTRUCTION ( _sid,
... )
Value:
.errorType(armarx::control::ethercat::ReportingType::Slave) \
.metaInfo(__FILE__, __LINE__, ARMARX_FUNCTION) \
.message(__VA_ARGS__) \
Entry & slaveIdentifier(SlaveIdentifier sid)
Definition ErrorReporting.cpp:329

◆ BUS_DEBUG

#define BUS_DEBUG ( bin,
... )
Value:
#define _detail_BUS_REPORT_CONSTRUCTION(bin,...)
Definition ErrorReporting.h:294
ReportWrapper reportDebug(Entry &error)
Definition ErrorReporting.cpp:280
static Reporter & getGlobalErrorReporter()
Definition ErrorReporting.cpp:95

◆ BUS_ERROR

#define BUS_ERROR ( bin,
... )

◆ BUS_ERROR_LOCAL

#define BUS_ERROR_LOCAL ( reporter,
bin,
... )
Value:
(reporter).reportError(_detail_BUS_REPORT_CONSTRUCTION(bin, __VA_ARGS__))

◆ BUS_FATAL_AND_THROW

#define BUS_FATAL_AND_THROW ( bin,
... )

◆ BUS_INFO

#define BUS_INFO ( bin,
... )
Value:

◆ BUS_WARNING

#define BUS_WARNING ( bin,
... )

◆ BUS_WARNING_LOCAL

#define BUS_WARNING_LOCAL ( reporter,
bin,
... )
Value:
(reporter).reportWarning(_detail_BUS_REPORT_CONSTRUCTION(bin, __VA_ARGS__))

◆ DEVICE_ERROR

#define DEVICE_ERROR ( deviceName,
... )
Value:
_detail_DEVICE_REPORT_CONSTRUCTION(deviceName, __VA_ARGS__))
#define _detail_DEVICE_REPORT_CONSTRUCTION(devName,...)
Definition ErrorReporting.h:352

◆ DEVICE_ERROR_LOCAL

#define DEVICE_ERROR_LOCAL ( reporter,
deviceName,
... )
Value:
(reporter).reportError(_detail_DEVICE_REPORT_CONSTRUCTION(deviceName, __VA_ARGS__))

◆ DEVICE_FATAL_AND_THROW

#define DEVICE_FATAL_AND_THROW ( deviceName,
... )

◆ DEVICE_INFO

#define DEVICE_INFO ( deviceName,
... )

◆ DEVICE_WARNING

#define DEVICE_WARNING ( deviceName,
... )

◆ DEVICE_WARNING_LOCAL

#define DEVICE_WARNING_LOCAL ( reporter,
deviceName,
... )
Value:
(reporter).reportWarning(_detail_DEVICE_REPORT_CONSTRUCTION(deviceName, __VA_ARGS__))

◆ GENERAL_DEBUG

#define GENERAL_DEBUG ( ...)
Value:
#define _detail_GENERAL_REPORT_CONSTRUCTION(...)
Definition ErrorReporting.h:273

◆ GENERAL_ERROR

◆ GENERAL_INFO

◆ GENERAL_WARNING

◆ SLAVE_DEBUG

#define SLAVE_DEBUG ( sid,
... )
Value:
#define _detail_SLAVE_REPORT_CONSTRUCTION(_sid,...)
Definition ErrorReporting.h:323

◆ SLAVE_ERROR

◆ SLAVE_ERROR_LOCAL

#define SLAVE_ERROR_LOCAL ( reporter,
sid,
... )
Value:
(reporter).reportError(_detail_SLAVE_REPORT_CONSTRUCTION(sid, __VA_ARGS__))

◆ SLAVE_FATAL_AND_THROW

#define SLAVE_FATAL_AND_THROW ( sid,
... )

◆ SLAVE_INFO

◆ SLAVE_WARNING

◆ SLAVE_WARNING_LOCAL

#define SLAVE_WARNING_LOCAL ( reporter,
sid,
... )
Value:
(reporter).reportWarning(_detail_SLAVE_REPORT_CONSTRUCTION(sid, __VA_ARGS__))