18# define __YFUNCTION__ __PRETTY_FUNCTION__
19#elif defined(_MSC_VER)
20# define __YFUNCTION__ __FUNCSIG__
21#elif (__cplusplus <= 199711)
22# define __YFUNCTION__ __func__
24# define __YFUNCTION__ "(unknown function)"
32# define YARP_ATTRIBUTE_FORMAT(style, fmt, args) __attribute__((format(printf, (fmt), (args))))
34# define YARP_ATTRIBUTE_FORMAT(style, fmt, args)
44#ifndef DOXYGEN_SHOULD_SKIP_THIS
56 const unsigned int line,
63 const unsigned int line,
65 const std::string_view
id,
71 const unsigned int line,
73 const double externaltime,
79 const unsigned int line,
81 const std::string_view
id,
82 const double externaltime,
98 LogTypeReserved = 0xFF
124 const unsigned int line,
149#ifndef DOXYGEN_SHOULD_SKIP_THIS
150 static void nolog(
const char* msg, ...) {}
153 template <
typename T>
159 static NoLog nolog() {
return NoLog(); }
162 std::unique_ptr<yarp::os::impl::LogPrivate>
const mPriv;
170 const unsigned int line,
175 const LogComponent& comp_name,
176 const std::string_view
id);
179 static const LogComponent& defaultLogComponent();
182 static const LogComponent& logInternalComponent();
189#define YARP_ONCE_CALLBACK \
191 static std::atomic_flag flag = ATOMIC_FLAG_INIT; \
192 return !flag.test_and_set(); \
195#define YARP_THREADONCE_CALLBACK \
197 thread_local std::atomic_flag flag = ATOMIC_FLAG_INIT; \
198 return !flag.test_and_set(); \
204#define YARP_THROTTLE_CALLBACK(period) \
206 static double last = -period; \
207 std::mutex* mutex_throttle_callback = yarp::os::Log::getLogMutex(); \
208 std::lock_guard<std::mutex> lock(*mutex_throttle_callback);\
209 double now = yarp::os::SystemClock::nowSystem(); \
210 if (now >= last + period) { \
217#define YARP_THREADTHROTTLE_CALLBACK(period) \
219 thread_local double last = -period; \
220 double now = yarp::os::SystemClock::nowSystem(); \
221 if (now >= last + period) { \
231# define yTrace(...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__).trace(__VA_ARGS__)
232# define yTraceOnce(...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, YARP_ONCE_CALLBACK).trace(__VA_ARGS__)
233# define yTraceThreadOnce(...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, YARP_THREADONCE_CALLBACK).trace(__VA_ARGS__)
234# define yTraceThrottle(period, ...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, YARP_THROTTLE_CALLBACK(period)).trace(__VA_ARGS__)
235# define yTraceThreadThrottle(period, ...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, YARP_THREADTHROTTLE_CALLBACK(period)).trace(__VA_ARGS__)
236# define yTraceExternalTime(externaltime, ...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, externaltime).trace(__VA_ARGS__)
237# define yTraceExternalTimeOnce(externaltime, ...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, externaltime, YARP_ONCE_CALLBACK).trace(__VA_ARGS__)
238# define yTraceExternalTimeThreadOnce(externaltime, ...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, externaltime, YARP_THREADONCE_CALLBACK).trace(__VA_ARGS__)
239# define yTraceExternalTimeThrottle(externaltime, period, ...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, externaltime, YARP_THROTTLE_CALLBACK(period)).trace(__VA_ARGS__)
240# define yTraceExternalTimeThreadThrottle(externaltime, period, ...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, externaltime, YARP_THREADTHROTTLE_CALLBACK(period)).trace(__VA_ARGS__)
241# define yITrace(id, ...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, id).trace(__VA_ARGS__)
242# define yITraceOnce(id, ...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, id, YARP_ONCE_CALLBACK).trace(__VA_ARGS__)
243# define yITraceThreadOnce(id, ...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, id, YARP_THREADONCE_CALLBACK).trace(__VA_ARGS__)
244# define yITraceThrottle(id, period, ...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, id, YARP_THROTTLE_CALLBACK(period)).trace(__VA_ARGS__)
245# define yITraceThreadThrottle(id, period, ...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, id, YARP_THREADTHROTTLE_CALLBACK(period)).trace(__VA_ARGS__)
246# define yITraceExternalTime(id, externaltime, ...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, id, externaltime).trace(__VA_ARGS__)
247# define yITraceExternalTimeOnce(id, externaltime, ...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, id, externaltime, YARP_ONCE_CALLBACK).trace(__VA_ARGS__)
248# define yITraceExternalTimeThreadOnce(id, externaltime, ...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, id, externaltime, YARP_THREADONCE_CALLBACK).trace(__VA_ARGS__)
249# define yITraceExternalTimeThrottle(id, externaltime, period, ...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, id, externaltime, YARP_THROTTLE_CALLBACK(period)).trace(__VA_ARGS__)
250# define yITraceExternalTimeThreadThrottle(id, externaltime, period, ...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, id, externaltime, YARP_THREADTHROTTLE_CALLBACK(period)).trace(__VA_ARGS__)
252# define yTrace(...) yarp::os::Log::nolog(__VA_ARGS__)
253# define yTraceOnce(...) yarp::os::Log::nolog(__VA_ARGS__)
254# define yTraceThreadOnce(...) yarp::os::Log::nolog(__VA_ARGS__)
255# define yTraceThrottle(period, ...) yarp::os::Log::nolog(__VA_ARGS__)
256# define yTraceThreadThrottle(period, ...) yarp::os::Log::nolog(__VA_ARGS__)
257# define yTraceExternalTime(externaltime, ...) yarp::os::Log::nolog(__VA_ARGS__)
258# define yTraceExternalTimeOnce(externaltime, ...) yarp::os::Log::nolog(__VA_ARGS__)
259# define yTraceExternalTimeThreadOnce(externaltime, ...) yarp::os::Log::nolog(__VA_ARGS__)
260# define yTraceExternalTimeThrottle(externaltime, period, ...) yarp::os::Log::nolog(__VA_ARGS__)
261# define yTraceExternalTimeThreadThrottle(externaltime, period, ...) yarp::os::Log::nolog(__VA_ARGS__)
262# define yITrace(id, ...) yarp::os::Log::nolog(__VA_ARGS__)
263# define yITraceOnce(id, ...) yarp::os::Log::nolog(__VA_ARGS__)
264# define yITraceThreadOnce(id, ...) yarp::os::Log::nolog(__VA_ARGS__)
265# define yITraceThrottle(id, period, ...) yarp::os::Log::nolog(__VA_ARGS__)
266# define yITraceThreadThrottle(id, period, ...) yarp::os::Log::nolog(__VA_ARGS__)
267# define yITraceExternalTime(id, externaltime, ...) yarp::os::Log::nolog(__VA_ARGS__)
268# define yITraceExternalTimeOnce(id, externaltime, ...) yarp::os::Log::nolog(__VA_ARGS__)
269# define yITraceExternalTimeThreadOnce(id, externaltime, ...) yarp::os::Log::nolog(__VA_ARGS__)
270# define yITraceExternalTimeThrottle(id, externaltime, period, ...) yarp::os::Log::nolog(__VA_ARGS__)
271# define yITraceExternalTimeThreadThrottle(id, externaltime, period, ...) yarp::os::Log::nolog(__VA_ARGS__)
274#ifndef YARP_NO_DEBUG_OUTPUT
275# define yDebug(...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__).debug(__VA_ARGS__)
276# define yDebugOnce(...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, YARP_ONCE_CALLBACK).debug(__VA_ARGS__)
277# define yDebugThreadOnce(...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, YARP_THREADONCE_CALLBACK).debug(__VA_ARGS__)
278# define yDebugThrottle(period, ...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, YARP_THROTTLE_CALLBACK(period)).debug(__VA_ARGS__)
279# define yDebugThreadThrottle(period, ...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, YARP_THREADTHROTTLE_CALLBACK(period)).debug(__VA_ARGS__)
280# define yDebugExternalTime(externaltime, ...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, externaltime).debug(__VA_ARGS__)
281# define yDebugExternalTimeOnce(externaltime, ...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, externaltime, YARP_ONCE_CALLBACK).debug(__VA_ARGS__)
282# define yDebugExternalTimeThreadOnce(externaltime, ...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, externaltime, YARP_THREADONCE_CALLBACK).debug(__VA_ARGS__)
283# define yDebugExternalTimeThrottle(externaltime, period, ...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, externaltime, YARP_THROTTLE_CALLBACK(period)).debug(__VA_ARGS__)
284# define yDebugExternalTimeThreadThrottle(externaltime, period, ...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, externaltime, YARP_THREADTHROTTLE_CALLBACK(period)).debug(__VA_ARGS__)
285# define yIDebug(id, ...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, id).debug(__VA_ARGS__)
286# define yIDebugOnce(id, ...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, id, YARP_ONCE_CALLBACK).debug(__VA_ARGS__)
287# define yIDebugThreadOnce(id, ...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, id, YARP_THREADONCE_CALLBACK).debug(__VA_ARGS__)
288# define yIDebugThrottle(id, period, ...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, id, YARP_THROTTLE_CALLBACK(period)).debug(__VA_ARGS__)
289# define yIDebugThreadThrottle(id, period, ...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, id, YARP_THREADTHROTTLE_CALLBACK(period)).debug(__VA_ARGS__)
290# define yIDebugExternalTime(id, externaltime, ...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, id, externaltime).debug(__VA_ARGS__)
291# define yIDebugExternalTimeOnce(id, externaltime, ...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, id, externaltime, YARP_ONCE_CALLBACK).debug(__VA_ARGS__)
292# define yIDebugExternalTimeThreadOnce(id, externaltime, ...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, id, externaltime, YARP_THREADONCE_CALLBACK).debug(__VA_ARGS__)
293# define yIDebugExternalTimeThrottle(id, externaltime, period, ...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, id, externaltime, YARP_THROTTLE_CALLBACK(period)).debug(__VA_ARGS__)
294# define yIDebugExternalTimeThreadThrottle(id, externaltime, period, ...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, id, externaltime, YARP_THREADTHROTTLE_CALLBACK(period)).debug(__VA_ARGS__)
296# define yDebug(...) yarp::os::Log::nolog(__VA_ARGS__)
297# define yDebugOnce(...) yarp::os::Log::nolog(__VA_ARGS__)
298# define yDebugThreadOnce(...) yarp::os::Log::nolog(__VA_ARGS__)
299# define yDebugThrottle(period, ...) yarp::os::Log::nolog(__VA_ARGS__)
300# define yDebugThreadThrottle(period, ...) yarp::os::Log::nolog(__VA_ARGS__)
301# define yDebugExternalTime(externaltime, ...) yarp::os::Log::nolog(__VA_ARGS__)
302# define yDebugExternalTimeOnce(externaltime, ...) yarp::os::Log::nolog(__VA_ARGS__)
303# define yDebugExternalTimeThreadOnce(externaltime, ...) yarp::os::Log::nolog(__VA_ARGS__)
304# define yDebugExternalTimeThrottle(externaltime, period, ...) yarp::os::Log::nolog(__VA_ARGS__)
305# define yDebugExternalTimeThreadThrottle(externaltime, period, ...) yarp::os::Log::nolog(__VA_ARGS__)
306# define yIDebug(id, ...) yarp::os::Log::nolog(__VA_ARGS__)
307# define yIDebugOnce(id, ...) yarp::os::Log::nolog(__VA_ARGS__)
308# define yIDebugThreadOnce(id, ...) yarp::os::Log::nolog(__VA_ARGS__)
309# define yIDebugThrottle(id, period, ...) yarp::os::Log::nolog(__VA_ARGS__)
310# define yIDebugThreadThrottle(id, period, ...) yarp::os::Log::nolog(__VA_ARGS__)
311# define yIDebugExternalTime(id, externaltime, ...) yarp::os::Log::nolog(__VA_ARGS__)
312# define yIDebugExternalTimeOnce(id, externaltime, ...) yarp::os::Log::nolog(__VA_ARGS__)
313# define yIDebugExternalTimeThreadOnce(id, externaltime, ...) yarp::os::Log::nolog(__VA_ARGS__)
314# define yIDebugExternalTimeThrottle(id, externaltime, period, ...) yarp::os::Log::nolog(__VA_ARGS__)
315# define yIDebugExternalTimeThreadThrottle(id, externaltime, period, ...) yarp::os::Log::nolog(__VA_ARGS__)
319#define yInfo(...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__).info(__VA_ARGS__)
320#define yInfoOnce(...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, YARP_ONCE_CALLBACK).info(__VA_ARGS__)
321#define yInfoThreadOnce(...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, YARP_THREADONCE_CALLBACK).info(__VA_ARGS__)
322#define yInfoThrottle(period, ...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, YARP_THROTTLE_CALLBACK(period)).info(__VA_ARGS__)
323#define yInfoThreadThrottle(period, ...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, YARP_THREADTHROTTLE_CALLBACK(period)).info(__VA_ARGS__)
324#define yInfoExternalTime(externaltime, ...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, externaltime).info(__VA_ARGS__)
325#define yInfoExternalTimeOnce(externaltime, ...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, externaltime, YARP_ONCE_CALLBACK).info(__VA_ARGS__)
326#define yInfoExternalTimeThreadOnce(externaltime, ...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, externaltime, YARP_THREADONCE_CALLBACK).info(__VA_ARGS__)
327#define yInfoExternalTimeThrottle(externaltime, period, ...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, externaltime, YARP_THROTTLE_CALLBACK(period)).info(__VA_ARGS__)
328#define yInfoExternalTimeThreadThrottle(externaltime, period, ...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, externaltime, YARP_THREADTHROTTLE_CALLBACK(period)).info(__VA_ARGS__)
329#define yIInfo(id, ...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, id).info(__VA_ARGS__)
330#define yIInfoOnce(id, ...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, id, YARP_ONCE_CALLBACK).info(__VA_ARGS__)
331#define yIInfoThreadOnce(id, ...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, id, YARP_THREADONCE_CALLBACK).info(__VA_ARGS__)
332#define yIInfoThrottle(id, period, ...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, id, YARP_THROTTLE_CALLBACK(period)).info(__VA_ARGS__)
333#define yIInfoThreadThrottle(id, period, ...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, id, YARP_THREADTHROTTLE_CALLBACK(period)).info(__VA_ARGS__)
334#define yIInfoExternalTime(id, externaltime, ...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, id, externaltime).info(__VA_ARGS__)
335#define yIInfoExternalTimeOnce(id, externaltime, ...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, id, externaltime, YARP_ONCE_CALLBACK).info(__VA_ARGS__)
336#define yIInfoExternalTimeThreadOnce(id, externaltime, ...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, id, externaltime, YARP_THREADONCE_CALLBACK).info(__VA_ARGS__)
337#define yIInfoExternalTimeThrottle(id, externaltime, period, ...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, id, externaltime, YARP_THROTTLE_CALLBACK(period)).info(__VA_ARGS__)
338#define yIInfoExternalTimeThreadThrottle(id, externaltime, period, ...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, id, externaltime, YARP_THREADTHROTTLE_CALLBACK(period)).info(__VA_ARGS__)
340#define yWarning(...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__).warning(__VA_ARGS__)
341#define yWarningOnce(...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, YARP_ONCE_CALLBACK).warning(__VA_ARGS__)
342#define yWarningThreadOnce(...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, YARP_THREADONCE_CALLBACK).warning(__VA_ARGS__)
343#define yWarningThrottle(period, ...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, YARP_THROTTLE_CALLBACK(period)).warning(__VA_ARGS__)
344#define yWarningThreadThrottle(period, ...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, YARP_THREADTHROTTLE_CALLBACK(period)).warning(__VA_ARGS__)
345#define yWarningExternalTime(externaltime, ...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, externaltime).warning(__VA_ARGS__)
346#define yWarningExternalTimeOnce(externaltime, ...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, externaltime, YARP_ONCE_CALLBACK).warning(__VA_ARGS__)
347#define yWarningExternalTimeThreadOnce(externaltime, ...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, externaltime, YARP_THREADONCE_CALLBACK).warning(__VA_ARGS__)
348#define yWarningExternalTimeThrottle(externaltime, period, ...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, externaltime, YARP_THROTTLE_CALLBACK(period)).warning(__VA_ARGS__)
349#define yWarningExternalTimeThreadThrottle(externaltime, period, ...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, externaltime, YARP_THREADTHROTTLE_CALLBACK(period)).warning(__VA_ARGS__)
350#define yIWarning(id, ...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, id).warning(__VA_ARGS__)
351#define yIWarningOnce(id, ...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, id, YARP_ONCE_CALLBACK).warning(__VA_ARGS__)
352#define yIWarningThreadOnce(id, ...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, id, YARP_THREADONCE_CALLBACK).warning(__VA_ARGS__)
353#define yIWarningThrottle(id, period, ...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, id, YARP_THROTTLE_CALLBACK(period)).warning(__VA_ARGS__)
354#define yIWarningThreadThrottle(id, period, ...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, id, YARP_THREADTHROTTLE_CALLBACK(period)).warning(__VA_ARGS__)
355#define yIWarningExternalTime(id, externaltime, ...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, id, externaltime).warning(__VA_ARGS__)
356#define yIWarningExternalTimeOnce(id, externaltime, ...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, id, externaltime, YARP_ONCE_CALLBACK).warning(__VA_ARGS__)
357#define yIWarningExternalTimeThreadOnce(id, externaltime, ...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, id, externaltime, YARP_THREADONCE_CALLBACK).warning(__VA_ARGS__)
358#define yIWarningExternalTimeThrottle(id, externaltime, period, ...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, id, externaltime, YARP_THROTTLE_CALLBACK(period)).warning(__VA_ARGS__)
359#define yIWarningExternalTimeThreadThrottle(id, externaltime, period, ...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, id, externaltime, YARP_THREADTHROTTLE_CALLBACK(period)).warning(__VA_ARGS__)
361#define yError(...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__).error(__VA_ARGS__)
362#define yErrorOnce(...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, YARP_ONCE_CALLBACK).error(__VA_ARGS__)
363#define yErrorThreadOnce(...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, YARP_THREADONCE_CALLBACK).error(__VA_ARGS__)
364#define yErrorThrottle(period, ...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, YARP_THROTTLE_CALLBACK(period)).error(__VA_ARGS__)
365#define yErrorThreadThrottle(period, ...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, YARP_THREADTHROTTLE_CALLBACK(period)).error(__VA_ARGS__)
366#define yErrorExternalTime(externaltime, ...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, externaltime).error(__VA_ARGS__)
367#define yErrorExternalTimeOnce(externaltime, ...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, externaltime, YARP_ONCE_CALLBACK).error(__VA_ARGS__)
368#define yErrorExternalTimeThreadOnce(externaltime, ...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, externaltime, YARP_THREADONCE_CALLBACK).error(__VA_ARGS__)
369#define yErrorExternalTimeThrottle(externaltime, period, ...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, externaltime, YARP_THROTTLE_CALLBACK(period)).error(__VA_ARGS__)
370#define yErrorExternalTimeThreadThrottle(externaltime, period, ...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, externaltime, YARP_THREADTHROTTLE_CALLBACK(period)).error(__VA_ARGS__)
371#define yIError(id, ...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, id).error(__VA_ARGS__)
372#define yIErrorOnce(id, ...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, id, YARP_ONCE_CALLBACK).error(__VA_ARGS__)
373#define yIErrorThreadOnce(id, ...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, id, YARP_THREADONCE_CALLBACK).error(__VA_ARGS__)
374#define yIErrorThrottle(id, period, ...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, id, YARP_THROTTLE_CALLBACK(period)).error(__VA_ARGS__)
375#define yIErrorThreadThrottle(id, period, ...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, id, YARP_THREADTHROTTLE_CALLBACK(period)).error(__VA_ARGS__)
376#define yIErrorExternalTime(id, externaltime, ...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, id, externaltime).error(__VA_ARGS__)
377#define yIErrorExternalTimeOnce(id, externaltime, ...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, id, externaltime, YARP_ONCE_CALLBACK).error(__VA_ARGS__)
378#define yIErrorExternalTimeThreadOnce(id, externaltime, ...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, id, externaltime, YARP_THREADONCE_CALLBACK).error(__VA_ARGS__)
379#define yIErrorExternalTimeThrottle(id, externaltime, period, ...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, id, externaltime, YARP_THROTTLE_CALLBACK(period)).error(__VA_ARGS__)
380#define yIErrorExternalTimeThreadThrottle(id, externaltime, period, ...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, id, externaltime, YARP_THREADTHROTTLE_CALLBACK(period)).error(__VA_ARGS__)
382#define yFatal(...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__).fatal(__VA_ARGS__)
383#define yFatalExternalTime(externaltime, ...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, externaltime).fatal(__VA_ARGS__)
384#define yIFatal(id, ...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, id).fatal(__VA_ARGS__)
385#define yIFatalExternalTime(id, externaltime, ...) yarp::os::Log(__FILE__, __LINE__, __YFUNCTION__, id, externaltime).fatal(__VA_ARGS__)
390 yFatal("Assertion failure at %s:%d (%s)", __FILE__, __LINE__, #x); \
392# define yAssertExternalTime(externaltime, x) \
394 yFatalExternalTime(externaltime, "Assertion failure at %s:%d (%s)", __FILE__, __LINE__, #x); \
396# define yIAssert(id, x) \
398 yIFatal(id, "Assertion failure at %s:%d (%s)", __FILE__, __LINE__, #x); \
400# define yIAssertExternalTime(id, externaltime, x) \
402 yIFatalExternalTime(id, externaltime, "Assertion failure at %s:%d (%s)", __FILE__, __LINE__, #x); \
406# define yAssertExternalTime(externaltime, x) { YARP_UNUSED(externaltime); }
407# define yIAssert(x) { YARP_UNUSED(id); }
408# define yIAssertExternalTime(externaltime, x) { YARP_UNUSED(id); YARP_UNUSED(externaltime); }
411#define YARP_FIXME_NOTIMPLEMENTED(what) yWarning("FIXME: %s not yet implemented", what);
#define YARP_ATTRIBUTE_FORMAT(style, fmt, args)
void yarp_print_trace(FILE *out, const char *file, unsigned int line)
Low level function for printing a stack trace, if implemented (ACE or gcc/Linux).
A mini-server for performing network communication in the background.
static std::mutex * getLogMutex()
void(*)(yarp::os::Log::LogType type, const char *msg, const char *file, const unsigned int line, const char *func, double systemtime, double networktime, double externaltime, const char *comp_name, const char *id) LogCallback
An interface to the operating system, including Port based communication.
The main, catch-all namespace for YARP.
std::ostream & operator<<(std::ostream &os, StrStream &sstr)