Logging header.
More...
#include <logicalaccess/plugins/llacommon/lla_common_api.hpp>
#include <logicalaccess/lla_fwd.hpp>
#include <fstream>
#include <map>
#include <sstream>
#include <vector>
#include <array>
#include <cstdint>
Go to the source code of this file.
|
| #define | EXCEPTION(type, ...) type(/*__FUNCTION__ "," __FILE__ "," __LINE__ " : "*/ __VA_ARGS__) |
| | Convenient alias to create an exception.
|
| |
| #define | EXCEPTION_ASSERT(condition, type, msg) |
| | Assertion which raises an exception on failure.
|
| |
| #define | LOG(x) logicalaccess::Logs(__FILE__, __FUNCTION__, __LINE__, x) |
| |
| #define | TRACE(...) |
| |
| #define | LLA_LOG_CTX(param) |
| |
| #define | THROW_EXCEPTION_WITH_LOG(type, msg, ...) |
| |
| #define | EXCEPTION_ASSERT_WITH_LOG(condition, type, msg, ...) |
| |
|
| enum | logicalaccess::LogLevel {
logicalaccess::NONE = 0
, logicalaccess::TRACE
, logicalaccess::INFOS
, logicalaccess::WARNINGS
,
logicalaccess::NOTICES
, logicalaccess::ERRORS
, logicalaccess::EMERGENSYS
, logicalaccess::CRITICALS
,
logicalaccess::ALERTS
, logicalaccess::DEBUGS
, logicalaccess::COMS
, logicalaccess::PLUGINS
,
logicalaccess::PLUGINS_ERROR
} |
| |
|
| std::ostream & | logicalaccess::operator<< (std::ostream &ss, const ByteVector &bytebuff) |
| |
| std::ostream & | logicalaccess::operator<< (std::ostream &ss, const std::vector< bool > &bytebuff) |
| |
| template<long unsigned int Size> |
| std::ostream & | logicalaccess::operator<< (std::ostream &ss, const std::array< uint8_t, Size > &bytearray) |
| |
| void | logicalaccess::trace_print_helper (std::stringstream &ss, const char *param_names, int) |
| |
| std::string | logicalaccess::get_nth_param_name (const char *param_names, int idx) |
| |
| template<typename Current , typename... T> |
| std::enable_if<!std::is_same< unsignedchar, typenamestd::remove_reference< Current >::type >::value >::type | logicalaccess::trace_print_helper (std::stringstream &ss, const char *param_names, int idx, Current &&c, T &&... args) |
| |
| template<typename Current , typename... T> |
| std::enable_if< std::is_same< unsignedchar, typenamestd::remove_reference< Current >::type >::value >::type | logicalaccess::trace_print_helper (std::stringstream &ss, const char *param_names, int idx, Current &&c, T &&... args) |
| |
| template<typename... T> |
| void | logicalaccess::trace_print (std::stringstream &ss, const char *param_names, T &&... params) |
| |
◆ EXCEPTION
| #define EXCEPTION |
( |
|
type, |
|
|
|
... |
|
) |
| type(/*__FUNCTION__ "," __FILE__ "," __LINE__ " : "*/ __VA_ARGS__) |
Convenient alias to create an exception.
◆ EXCEPTION_ASSERT
| #define EXCEPTION_ASSERT |
( |
|
condition, |
|
|
|
type, |
|
|
|
msg |
|
) |
| |
Value: if (!(condition)) \
{ \
}
#define EXCEPTION(type,...)
Convenient alias to create an exception.
Definition: logs.hpp:14
Assertion which raises an exception on failure.
◆ EXCEPTION_ASSERT_WITH_LOG
| #define EXCEPTION_ASSERT_WITH_LOG |
( |
|
condition, |
|
|
|
type, |
|
|
|
msg, |
|
|
|
... |
|
) |
| |
Value: if (!(condition)) \
{ \
THROW_EXCEPTION_WITH_LOG(type, msg, ##__VA_ARGS__); \
}
Assertion which raises an exception on failure with logs.
◆ LLA_LOG_CTX
| #define LLA_LOG_CTX |
( |
|
param | ) |
|
Value: LogContext lla_log_ctx([&](void) { \
std::stringstream logger_macro_ss__; \
logger_macro_ss__ << param; \
return logger_macro_ss__.str(); \
}())
◆ LOG
◆ THROW_EXCEPTION_WITH_LOG
| #define THROW_EXCEPTION_WITH_LOG |
( |
|
type, |
|
|
|
msg, |
|
|
|
... |
|
) |
| |
Value: { \
}
@ ERRORS
Definition: logs.hpp:44
Convenient alias to throw an exception with logs.
◆ TRACE
Value: std::stringstream trace_stringstream; \
trace_print(trace_stringstream, #__VA_ARGS__, ##__VA_ARGS__); \
LOG(
TRACE) << trace_stringstream.str();
#define TRACE(...)
Definition: logs.hpp:217
Log something at the TRACE level. This is a variadic macro that accepts all parameters types and will output something like [param_name -> param_value]