EPS Conduits  v0.0.2-2413
networking over networking
logging.hpp File Reference
#include <boost/log/trivial.hpp>
#include "common.hpp"
Include dependency graph for logging.hpp:
This graph shows which files directly or indirectly include this file:

Namespaces

 EPS
 

Macros

#define LOG_TRACE   BOOST_LOG_TRIVIAL(trace)
 All logging should be done using one of the EPS LOG macros. More...
 
#define LOG_DEBUG   BOOST_LOG_TRIVIAL(debug)
 All logging should be done using one of the EPS LOG macros. More...
 
#define LOG_INFO   BOOST_LOG_TRIVIAL(info)
 All logging should be done using one of the EPS LOG macros. More...
 
#define LOG_WARN   BOOST_LOG_TRIVIAL(warning)
 All logging should be done using one of the EPS LOG macros. More...
 
#define LOG_ERROR   BOOST_LOG_TRIVIAL(error)
 All logging should be done using one of the EPS LOG macros. More...
 
#define LOG_FATAL   BOOST_LOG_TRIVIAL(fatal)
 All logging should be done using one of the EPS LOG macros. More...
 
#define THROW_RUNTIME_ERROR(error_no, msg)
 Macros to both log and throw std::exception objects. More...
 
#define THROW_INVALID_ARGUMENT(error_no, msg)
 Macros to both log and throw std::exception objects. More...
 

Functions

void EPS::initialize_logging (const EPS::EMode mode)
 Initialize boost::log for EPS client/server. More...
 
void EPS::initialize_file_logging (const std::string &filename)
 Add the specified filename to the logging output. More...
 
void EPS::reset_logging (void)
 Reset boost::log and disable logging. More...
 
void EPS::log_backtrace (void)
 Log a line for every function name in the call stack. More...
 

Macro Definition Documentation

◆ LOG_DEBUG

#define LOG_DEBUG   BOOST_LOG_TRIVIAL(debug)

All logging should be done using one of the EPS LOG macros.

◆ LOG_ERROR

#define LOG_ERROR   BOOST_LOG_TRIVIAL(error)

All logging should be done using one of the EPS LOG macros.

◆ LOG_FATAL

#define LOG_FATAL   BOOST_LOG_TRIVIAL(fatal)

All logging should be done using one of the EPS LOG macros.

◆ LOG_INFO

#define LOG_INFO   BOOST_LOG_TRIVIAL(info)

All logging should be done using one of the EPS LOG macros.

◆ LOG_TRACE

#define LOG_TRACE   BOOST_LOG_TRIVIAL(trace)

All logging should be done using one of the EPS LOG macros.

◆ LOG_WARN

#define LOG_WARN   BOOST_LOG_TRIVIAL(warning)

All logging should be done using one of the EPS LOG macros.

◆ THROW_INVALID_ARGUMENT

#define THROW_INVALID_ARGUMENT (   error_no,
  msg 
)
Value:
LOG_ERROR << "Error in " << __PRETTY_FUNCTION__ << ": errno " << error_no << ": " << strerror(error_no); \
LOG_ERROR << "ERROR! " << msg; \
LOG_ERROR << "ERROR! Throwing std::invalid_argument due to previous error."; \
throw std::invalid_argument(msg);
void log_backtrace(void)
Log a line for every function name in the call stack.
Definition: logging.cpp:95

Macros to both log and throw std::exception objects.

◆ THROW_RUNTIME_ERROR

#define THROW_RUNTIME_ERROR (   error_no,
  msg 
)
Value:
LOG_ERROR << "Error in " << __PRETTY_FUNCTION__ << ": errno " << error_no << ": " << strerror(error_no); \
LOG_ERROR << "ERROR! " << msg; \
LOG_ERROR << "ERROR! Throwing std::runtime_error due to previous error."; \
throw std::runtime_error(msg);
void log_backtrace(void)
Log a line for every function name in the call stack.
Definition: logging.cpp:95

Macros to both log and throw std::exception objects.