mirror of
https://git.intern.spaceteamaachen.de/ALPAKA/sta-core.git
synced 2025-06-10 16:55:58 +00:00
62 lines
1.4 KiB
C++
62 lines
1.4 KiB
C++
#ifndef STA_CORE_DEBUGGING_HPP
|
|
#define STA_CORE_DEBUGGING_HPP
|
|
|
|
#include <sta/config.hpp>
|
|
#ifdef STA_DEBUGGING_ENABLED
|
|
|
|
#include <sta/debug/printing/printable.hpp>
|
|
|
|
namespace sta
|
|
{
|
|
extern Printable * Debug;
|
|
} // namespace sta
|
|
|
|
|
|
/**
|
|
* @brief Debug print message.
|
|
*
|
|
* @param ... See @ref sta::Printable::print
|
|
*
|
|
* @ingroup sta_core_debug
|
|
*/
|
|
# define STA_DEBUG_PRINT(...) sta::Debug->print(__VA_ARGS__)
|
|
|
|
/**
|
|
* @brief Debug print message followed by new-line to the printable.
|
|
*
|
|
* @param ... See @ref sta::Printable::println
|
|
*
|
|
* @ingroup sta_core_debug
|
|
*/
|
|
# define STA_DEBUG_PRINTLN(...) sta::Debug->println(__VA_ARGS__)
|
|
|
|
/**
|
|
* @brief Formatted debug printing with new-line.
|
|
*
|
|
* @param fmt See @ref sta::Printable::printf
|
|
* @param ... See @ref sta::Printable::printf
|
|
*
|
|
* @ingroup sta_core_debug
|
|
*/
|
|
# define STA_DEBUG_PRINTF(fmt, ...) sta::Debug->printf(fmt, __VA_ARGS__)
|
|
|
|
/**
|
|
* @brief Read data via printable.
|
|
*
|
|
* @param ... See @ref sta::Printable::read
|
|
*
|
|
* @ingroup sta_core_debug
|
|
*/
|
|
# define STA_DEBUG_READ(buffer, length) sta::Debug->read(buffer, length)
|
|
|
|
#else // !STA_DEBUGGING_ENABLED
|
|
|
|
# define STA_DEBUG_PRINT(...) ((void)0)
|
|
# define STA_DEBUG_PRINTLN(...) ((void)0)
|
|
# define STA_DEBUG_PRINTF(fmt, ...) ((void)0)
|
|
# define STA_DEBUG_READ(buffer, length) ((void)0)
|
|
|
|
#endif // STA_DEBUGGING_ENABLED
|
|
|
|
#endif // STA_CORE_DEBUGGING_HPP
|