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"
+ Include dependency graph for ErrorReporting.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

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

 armarx
 This file offers overloads of toIce() and fromIce() functions for STL container types.
 
 armarx::control
 
 armarx::control::ethercat
 
 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, ...)   (reporter).reportError(_detail_BUS_REPORT_CONSTRUCTION(bin, __VA_ARGS__))
 
#define BUS_FATAL_AND_THROW(bin, ...)
 
#define BUS_INFO(bin, ...)
 
#define BUS_WARNING(bin, ...)
 
#define BUS_WARNING_LOCAL(reporter, bin, ...)   (reporter).reportWarning(_detail_BUS_REPORT_CONSTRUCTION(bin, __VA_ARGS__))
 
#define DEVICE_ERROR(deviceName, ...)
 
#define DEVICE_ERROR_LOCAL(reporter, deviceName, ...)   (reporter).reportError(_detail_DEVICE_REPORT_CONSTRUCTION(deviceName, __VA_ARGS__))
 
#define DEVICE_FATAL_AND_THROW(deviceName, ...)
 
#define DEVICE_WARNING(deviceName, ...)
 
#define DEVICE_WARNING_LOCAL(reporter, deviceName, ...)   (reporter).reportWarning(_detail_DEVICE_REPORT_CONSTRUCTION(deviceName, __VA_ARGS__))
 
#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, ...)   (reporter).reportError(_detail_SLAVE_REPORT_CONSTRUCTION(sid, __VA_ARGS__))
 
#define SLAVE_FATAL_AND_THROW(sid, ...)
 
#define SLAVE_INFO(sid, ...)
 
#define SLAVE_WARNING(sid, ...)
 
#define SLAVE_WARNING_LOCAL(reporter, sid, ...)   (reporter).reportWarning(_detail_SLAVE_REPORT_CONSTRUCTION(sid, __VA_ARGS__))
 

Typedefs

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

Enumerations

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

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,
  ... 
)

◆ _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)

Definition at line 319 of file ErrorReporting.h.

◆ _detail_GENERAL_REPORT_CONSTRUCTION

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

Definition at line 240 of file ErrorReporting.h.

◆ _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__) \

Definition at line 290 of file ErrorReporting.h.

◆ BUS_DEBUG

#define BUS_DEBUG (   bin,
  ... 
)

◆ BUS_ERROR

#define BUS_ERROR (   bin,
  ... 
)

◆ BUS_ERROR_LOCAL

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

Definition at line 286 of file ErrorReporting.h.

◆ BUS_FATAL_AND_THROW

#define BUS_FATAL_AND_THROW (   bin,
  ... 
)

◆ BUS_INFO

#define BUS_INFO (   bin,
  ... 
)

◆ BUS_WARNING

#define BUS_WARNING (   bin,
  ... 
)

◆ BUS_WARNING_LOCAL

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

Definition at line 284 of file ErrorReporting.h.

◆ DEVICE_ERROR

#define DEVICE_ERROR (   deviceName,
  ... 
)

◆ DEVICE_ERROR_LOCAL

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

Definition at line 338 of file ErrorReporting.h.

◆ DEVICE_FATAL_AND_THROW

#define DEVICE_FATAL_AND_THROW (   deviceName,
  ... 
)

◆ DEVICE_WARNING

#define DEVICE_WARNING (   deviceName,
  ... 
)

◆ DEVICE_WARNING_LOCAL

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

Definition at line 336 of file ErrorReporting.h.

◆ GENERAL_DEBUG

#define GENERAL_DEBUG (   ...)

◆ GENERAL_ERROR

#define GENERAL_ERROR (   ...)

◆ GENERAL_INFO

#define GENERAL_INFO (   ...)

◆ GENERAL_WARNING

#define GENERAL_WARNING (   ...)

◆ SLAVE_DEBUG

#define SLAVE_DEBUG (   sid,
  ... 
)

◆ SLAVE_ERROR

#define SLAVE_ERROR (   sid,
  ... 
)

◆ SLAVE_ERROR_LOCAL

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

Definition at line 315 of file ErrorReporting.h.

◆ SLAVE_FATAL_AND_THROW

#define SLAVE_FATAL_AND_THROW (   sid,
  ... 
)

◆ SLAVE_INFO

#define SLAVE_INFO (   sid,
  ... 
)

◆ SLAVE_WARNING

#define SLAVE_WARNING (   sid,
  ... 
)

◆ SLAVE_WARNING_LOCAL

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

Definition at line 313 of file ErrorReporting.h.

armarx::control::ethercat::reporting::Reporting::getGlobalErrorReporter
static Reporter & getGlobalErrorReporter()
Definition: ErrorReporting.cpp:95
armarx::control::ethercat::reporting::Entry::busIterationNumber
Entry & busIterationNumber(std::uint64_t iteration)
Definition: ErrorReporting.cpp:378
armarx::control::ethercat::reporting::Type::Bus
@ Bus
Bussdfnödf.
_detail_GENERAL_REPORT_CONSTRUCTION
#define _detail_GENERAL_REPORT_CONSTRUCTION(...)
Definition: ErrorReporting.h:240
ARMARX_FUNCTION
#define ARMARX_FUNCTION
Definition: Logging.h:122
_detail_DEVICE_REPORT_CONSTRUCTION
#define _detail_DEVICE_REPORT_CONSTRUCTION(devName,...)
Definition: ErrorReporting.h:319
armarx::control::ethercat::reporting::Entry::message
Entry & message(const char *fmt, T... args)
Definition: ErrorReporting.h:107
_detail_BUS_REPORT_CONSTRUCTION
#define _detail_BUS_REPORT_CONSTRUCTION(bin,...)
Definition: ErrorReporting.h:261
armarx::control::ethercat::ReportingEntry
reporting::Entry ReportingEntry
Definition: ErrorReporting.h:234
armarx::control::ethercat::reporting::Reporter::reportDebug
ReportWrapper reportDebug(Entry &error)
Definition: ErrorReporting.cpp:276
armarx::control::ethercat::reporting::Reporter::reportInfo
ReportWrapper reportInfo(Entry &error)
Definition: ErrorReporting.cpp:283
armarx::control::ethercat::reporting::Entry::errorType
Entry & errorType(Type type)
Definition: ErrorReporting.cpp:332
armarx::control::ethercat::reporting::Entry::deviceName
Entry & deviceName(const char *deviceName)
Definition: ErrorReporting.cpp:348
armarx::control::ethercat::reporting::Reporter::reportWarning
ReportWrapper reportWarning(Entry &error)
Definition: ErrorReporting.cpp:290
armarx::control::ethercat::reporting::Reporter::reportError
ReportWrapper reportError(Entry &error)
Definition: ErrorReporting.cpp:298
_detail_SLAVE_REPORT_CONSTRUCTION
#define _detail_SLAVE_REPORT_CONSTRUCTION(_sid,...)
Definition: ErrorReporting.h:290
armarx::control::ethercat::reporting::Entry::slaveIdentifier
Entry & slaveIdentifier(SlaveIdentifier sid)
Definition: ErrorReporting.cpp:325
armarx::control::ethercat::reporting::Entry::metaInfo
Entry & metaInfo(const char *file, int line, const char *function)
Definition: ErrorReporting.cpp:339
armarx::control::ethercat::reporting::Reporter::reportErrorAndThrow
void reportErrorAndThrow(Entry &error)
Definition: ErrorReporting.cpp:306