libuavcan/libuavcan/include/uavcan/debug.hpp
Go to the documentation of this file.
1 /*
2  * Debug stuff, should only be used for library development.
3  * Copyright (C) 2014 Pavel Kirienko <pavel.kirienko@gmail.com>
4  */
5 
6 #ifndef UAVCAN_DEBUG_HPP_INCLUDED
7 #define UAVCAN_DEBUG_HPP_INCLUDED
8 
10 
11 #if UAVCAN_DEBUG
12 
13 # include <cstdio>
14 # include <cstdarg>
15 
16 # if __GNUC__
17 __attribute__ ((format(printf, 2, 3)))
18 # endif
19 static void UAVCAN_TRACE(const char* src, const char* fmt, ...)
20 {
21  va_list args;
22  (void)std::printf("UAVCAN: %s: ", src);
23  va_start(args, fmt);
24  (void)std::vprintf(fmt, args);
25  va_end(args);
26  (void)std::puts("");
27 }
28 
29 #else
30 
31 # define UAVCAN_TRACE(...) ((void)0)
32 
33 #endif
34 
35 #endif // UAVCAN_DEBUG_HPP_INCLUDED
UAVCAN_TRACE
#define UAVCAN_TRACE(...)
Definition: libuavcan/libuavcan/include/uavcan/debug.hpp:31
setup.args
args
Definition: pyuavcan/setup.py:22
build_config.hpp
__attribute__
__attribute__((gnu_inline)) inline void spi_start(uint8_t data)
Definition: spi.h:74
test.format
format
Definition: dsdl/test.py:6


uavcan_communicator
Author(s):
autogenerated on Fri Dec 13 2024 03:10:02