diag-trace 5.0.0
µOS++ Tracing Infrastructure
Loading...
Searching...
No Matches

Primary C++ functions for outputting trace messages. More...

Functions

int micro_os_plus::trace::printf (const char *format,...) noexcept
 Write a formatted string to the trace output channel.
int micro_os_plus::trace::putchar (int c) noexcept
 Write the single character to the trace output channel.
int micro_os_plus::trace::puts (const char *s="") noexcept
 Write the string and a line terminator to the trace output channel.
int micro_os_plus::trace::vprintf (const char *format, std::va_list arguments) noexcept
 Write a formatted variable arguments list to the trace output channel.

Detailed Description

These functions serve as the primary methods for outputting trace messages in C++ projects.

Function Documentation

◆ printf()

int micro_os_plus::trace::printf ( const char * format,
... )
inlinenoexcept
Parameters
formatA null terminated string with the format.
...Additional arguments matching the format specifiers.
Returns
The number of bytes written, or -1 if an error occurred.

Thin wrapper over tracer<T>::printf(). Subject to the same fixed-size stack buffer constraint and truncation behaviour.

Definition at line 235 of file trace-cpp-api-inlines.h.

236 {
237 std::va_list arguments;
238 va_start (arguments, format);
239#pragma GCC diagnostic push
240#if defined(__clang__)
241#pragma clang diagnostic ignored "-Wunsafe-buffer-usage-in-libc-call"
242#endif
243 int ret
245#pragma GCC diagnostic pop
246 va_end (arguments);
247 return ret;
248 }
static int vprintf(const char *format, std::va_list arguments) noexcept
Write a formatted variable arguments list to the trace output channel.

References micro_os_plus::trace::detail::tracer< T >::vprintf().

Referenced by micro_os_plus::trace::detail::tracer< T >::dump_args().

◆ putchar()

int micro_os_plus::trace::putchar ( int c)
inlinenoexcept
Parameters
cA single byte character, passed as an int.
Returns
The written character as an int, or EOF (-1) if an error occurred.

Thin wrapper over tracer<T>::putchar().

Definition at line 273 of file trace-cpp-api-inlines.h.

274 {
276 }
static int putchar(int c) noexcept
Write the single character to the trace output channel.

References micro_os_plus::trace::detail::tracer< T >::putchar().

◆ puts()

int micro_os_plus::trace::puts ( const char * s = "")
inlinenoexcept
Parameters
sA null terminated string (default: empty string).
Returns
The total number of bytes written (string + newline), or EOF (-1) if an error occurred.

Thin wrapper over tracer<T>::puts().

Definition at line 262 of file trace-cpp-api-inlines.h.

263 {
264#pragma GCC diagnostic push
265#if defined(__clang__)
266#pragma clang diagnostic ignored "-Wunsafe-buffer-usage-in-libc-call"
267#endif
269#pragma GCC diagnostic pop
270 }
static int puts(const char *s="") noexcept
Write the string and a line terminator to the trace output channel.

References micro_os_plus::trace::detail::tracer< T >::puts().

◆ vprintf()

int micro_os_plus::trace::vprintf ( const char * format,
std::va_list arguments )
inlinenoexcept
Parameters
formatA null terminated string with the format.
argumentsA variable arguments list.
Returns
The number of bytes written, or -1 if an error occurred.

Thin wrapper over tracer<T>::vprintf().

Definition at line 251 of file trace-cpp-api-inlines.h.

252 {
253#pragma GCC diagnostic push
254#if defined(__clang__)
255#pragma clang diagnostic ignored "-Wunsafe-buffer-usage-in-libc-call"
256#endif
257 return detail::tracer<detail::implementation>::vprintf (format, arguments);
258#pragma GCC diagnostic pop
259 }

References micro_os_plus::trace::detail::tracer< T >::vprintf().

Referenced by micro_os_plus::trace::detail::tracer< T >::printf().