Main functions
Primary C functions for outputting trace messages. More...
Functions Index
| int | micro_os_plus_trace_printf (const char *format,...) |
|
Write a formatted string to the trace output channel. More... | |
| int | micro_os_plus_trace_putchar (int c) |
|
Write the single character to the trace output channel. More... | |
| int | micro_os_plus_trace_puts (const char *s) |
|
Write the string and a line terminator to the trace output channel. More... | |
| int | micro_os_plus_trace_vprintf (const char *format, va_list arguments) |
|
Write a formatted variable arguments list to the trace output channel. More... | |
Description
Primary C functions for outputting trace messages.
These functions constitute the primary methods for outputting trace messages in C projects.
Functions
micro_os_plus_trace_printf()
|
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.
Formatting is performed into a fixed-size stack buffer of MICRO_OS_PLUS_DIAG_TRACE_PRINTF_BUFFER_ARRAY_SIZE_INTEGER bytes (default: 200). If the formatted output exceeds this limit, it is silently truncated before being passed to micro_os_plus_trace_write. The return value reflects the number of bytes actually written, not the number that the format string would have produced.
Declaration at line 132 of file trace-c-api.h, definition at line 66 of file trace-c-api.cpp.
Reference micro_os_plus::trace::detail::tracer< T >::vprintf.
micro_os_plus_trace_putchar()
|
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.
Converts c to char and passes it as a one-byte buffer to micro_os_plus_trace_write. On success, returns the original value of c; on failure, returns EOF.
Declaration at line 186 of file trace-c-api.h, definition at line 105 of file trace-c-api.cpp.
Reference micro_os_plus::trace::detail::tracer< T >::putchar.
micro_os_plus_trace_puts()
|
Write the string and a line terminator to the trace output channel.
- Parameters
-
s A null terminated string.
- Returns
The total number of bytes written (string + newline), or EOF (-1) if an error occurred.
Writes the characters of s followed by a single newline character ('\n'). Unlike the standard C puts(), this function returns the total byte count written, not merely a non-negative indicator. If writing the newline fails after the string has been written successfully, EOF is returned.
Declaration at line 170 of file trace-c-api.h, definition at line 94 of file trace-c-api.cpp.
micro_os_plus_trace_vprintf()
|
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.
Equivalent to micro_os_plus_trace_printf, but accepts a va_list instead of a variadic argument list. Subject to the same fixed-size stack buffer constraint and truncation behaviour. Typically called by micro_os_plus_trace_printf.
Declaration at line 151 of file trace-c-api.h, definition at line 83 of file trace-c-api.cpp.
Reference micro_os_plus::trace::detail::tracer< T >::vprintf.
Generated via doxygen2docusaurus 2.2.1 by Doxygen 1.17.0.