/* * Debug stuff, should only be used for library development. * Copyright (C) 2014 Pavel Kirienko */ #pragma once #if UAVCAN_DEBUG #include #include #if __GNUC__ __attribute__ ((format (printf, 2, 3))) #endif static void UAVCAN_TRACE(const char* src, const char* fmt, ...) { va_list args; std::printf("UAVCAN: %s: ", src); va_start(args, fmt); std::vprintf(fmt, args); va_end(args); std::puts(""); } #else # define UAVCAN_TRACE(...) ((void)0) #endif