Skip to content
Snippets Groups Projects
Commit 49c42094 authored by Stéphane Poirier's avatar Stéphane Poirier
Browse files

New macros Y4T_LOG_DEBUG, Y4T_LOG_INFO, Y4T_LOG_WARNING, Y4T_LOG_ERROR

parent 82f6ac73
Branches
Tags
No related merge requests found
......@@ -205,6 +205,36 @@ private:
log4tango::Logger* logger_;
};
//- Macros to ease the use of formatted log methods in class instance inherited
// from TangoLogAdapter
// usage:
// Y4T_LOG_INFO("msg with this value: {} and this one: {}", value1, value2);
// Y4T_LOG_INFO("msg with no argument");
// Thus the arguments values are now between parenthesis!
#define Y4T_LOG_DEBUG(s, ...) \
do \
{ \
debug(s), ##__VA_ARGS__; \
} while(0)
#define Y4T_LOG_INFO(s, ...) \
do \
{ \
info(s), ##__VA_ARGS__; \
} while(0)
#define Y4T_LOG_WARNING(s, ...) \
do \
{ \
warn(s), ##__VA_ARGS__; \
} while(0)
#define Y4T_LOG_ERROR(s, ...) \
do \
{ \
error(s), ##__VA_ARGS__; \
} while(0)
#if defined (YAT4TANGO_ENABLE_TRACE)
// ============================================================================
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment