|
diag-trace 5.0.0
µOS++ Tracing Infrastructure
|
Primary C functions for outputting trace messages. More...
Functions | |
| int | micro_os_plus_trace_printf (const char *format,...) |
| Write a formatted string to the trace output channel. | |
| int | micro_os_plus_trace_putchar (int c) |
| Write the single character to the trace output channel. | |
| int | micro_os_plus_trace_puts (const char *s) |
| Write the string and a line terminator to the trace output channel. | |
| int | micro_os_plus_trace_vprintf (const char *format, va_list arguments) |
| Write a formatted variable arguments list to the trace output channel. | |
These functions constitute the primary methods for outputting trace messages in C projects.
| int micro_os_plus_trace_printf | ( | const char * | format, |
| ... ) |
| format | A null terminated string with the format. |
| ... | Additional arguments matching the format specifiers. |
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.
Definition at line 66 of file trace-c-api.cpp.
References micro_os_plus::trace::detail::tracer< T >::vprintf().
| int micro_os_plus_trace_putchar | ( | int | c | ) |
| c | A single byte character, passed as an int. |
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.
Definition at line 105 of file trace-c-api.cpp.
References micro_os_plus::trace::detail::tracer< T >::putchar().
| int micro_os_plus_trace_puts | ( | const char * | s | ) |
| s | A null terminated string. |
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.
Definition at line 94 of file trace-c-api.cpp.
References micro_os_plus::trace::detail::tracer< T >::puts().
| int micro_os_plus_trace_vprintf | ( | const char * | format, |
| va_list | arguments ) |
| format | A null terminated string with the format. |
| arguments | A variable arguments list. |
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.
Definition at line 83 of file trace-c-api.cpp.
References micro_os_plus::trace::detail::tracer< T >::vprintf().