7 #ifndef _LOG_FUNCTIONS_HEADER_
8 #define _LOG_FUNCTIONS_HEADER_
58 const tChar* strMessage =
nullptr,
59 const tChar* strSource =
nullptr)
111 #define _A_UTILS_STRINGIFY(__number) #__number
113 #define _A_UTILS_TO_STRING(__number) _A_UTILS_STRINGIFY(__number)
115 #define LOG_ADD_ENTRY(__level, ...)\
116 A_UTILS_NS::log::add_entry(__level, \
117 A_UTILS_NS::cString::Format(__VA_ARGS__).GetPtr(),\
118 A_UTILS_NS::cString::Format("%s:%d(%s)", __FILE__, __LINE__, __FUNC__).GetPtr())
122 #define LOG_DUMP(...) LOG_ADD_ENTRY(A_UTILS_NS::log::tLogLevel::Dump, __VA_ARGS__)
125 #define LOG_DUMP(...)
128 #define LOG_DETAIL(...) LOG_ADD_ENTRY(A_UTILS_NS::log::tLogLevel::Detail, __VA_ARGS__)
130 #define LOG_INFO(...) LOG_ADD_ENTRY(A_UTILS_NS::log::tLogLevel::Info, __VA_ARGS__)
132 #define LOG_WARNING(...) LOG_ADD_ENTRY(A_UTILS_NS::log::tLogLevel::Warning, __VA_ARGS__)
134 #define LOG_ERROR(...) LOG_ADD_ENTRY(A_UTILS_NS::log::tLogLevel::Error, __VA_ARGS__)
uint8_t tUInt8
type definition for unsigned integer values (8bit) (platform and compiler independent type).
char tChar
The tChar defines the type for platform character set (platform and compiler dependent type).
tInt64 tTimeStamp
type definition for a time value.
void tVoid
The tVoid is always the definition for the void (non-type).
static cDateTime GetCurrentDateTime()
Get the current date and time (hardware clock with respect to timezone).
tTimeStamp ToTimeStamp() const
Convert stored date and time to a timestamp.
tVoid set_filtered_logging(tUInt8 nMaxLogLevel, logger oLogger=default_logger)
Convenience method to filter log messages.
tVoid set_logger(logger oLogger)
Sets the currently used logger.
cString default_format(const tLogEntry &sEntry)
Returns the default string representation of a log entry.
std::function< tVoid(const tLogEntry &sEntry)> logger
Logger interface definition.
tVoid default_logger(const tLogEntry &sEntry)
Default logging method, that writes log messages to stdout.
logger get_logger()
Returns the currently used logger.
tVoid add_entry(const tLogEntry &sEntry)
Adds a new log entry to the current logger.
ADTF A_UTIL Namespace - Within adtf this is used as adtf::util or adtf_util.
const tChar * strMessage
the message text, optionally nullptr.
tUInt8 nLogLevel
the log level, see tLogLevel.
tTimeStamp nTimeStamp
time stamp of the log message.
const tChar * strSource
the origin of the entry, optionally nullptr.