Skip to main content

Main functions

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

Functions Index

intprintf (const char *format,...) noexcept

Write a formatted string to the trace output channel. More...

intputchar (int c) noexcept

Write the single character to the trace output channel. More...

intputs (const char *s="") noexcept

Write the string and a line terminator to the trace output channel. More...

intvprintf (const char *format, std::va_list arguments) noexcept

Write a formatted variable arguments list to the trace output channel. More...

Description

Primary C++ functions for outputting trace messages.

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

Functions

printf()

int micro_os_plus::trace::printf (const char * format, ...)
inline noexcept

Write a formatted string to the trace output channel.

Parameters
format

A 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.

235 printf (const char* format, ...) noexcept
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 }

Reference 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)
inline noexcept

Write the single character to the trace output channel.

Parameters
c

A 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.

273 putchar (int c) noexcept
274 {
276 }

Reference micro_os_plus::trace::detail::tracer< T >::putchar.

puts()

int micro_os_plus::trace::puts (const char * s="")
inline noexcept

Write the string and a line terminator to the trace output channel.

Parameters
s

A 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.

262 puts (const char* s) noexcept
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 }

Reference micro_os_plus::trace::detail::tracer< T >::puts.

vprintf()

int micro_os_plus::trace::vprintf (const char * format, std::va_list arguments)
inline noexcept

Write a formatted variable arguments list to the trace output channel.

Parameters
format

A null terminated string with the format.

arguments

A 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.

251 vprintf (const char* format, std::va_list arguments) noexcept
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 }

Reference micro_os_plus::trace::detail::tracer< T >::vprintf.

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


Generated via doxygen2docusaurus 2.2.1 by Doxygen 1.17.0.