Skip to content

Commit 8c6da79

Browse files
committed
logging: Clarify contract of log_output_func_t
The log_output_func_t backend function is supposed to either process or drop bytes and return the amount of those to the caller. Clarify this in the documentation. Fixes #12241 Signed-off-by: Carles Cufi <[email protected]>
1 parent f5c4e36 commit 8c6da79

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

include/logging/log_output.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,11 @@ extern "C" {
5050
* @param length Data length.
5151
* @param ctx User context.
5252
*
53-
* @return Number of bytes processed.
53+
* @return Number of bytes processed, dropped or discarded.
54+
*
55+
* @note If the log output function cannot process all of the data, it is
56+
* its responsibility to mark them as dropped or discarded by returning
57+
* the corresponding number of bytes dropped or discarded to the caller.
5458
*/
5559
typedef int (*log_output_func_t)(u8_t *buf, size_t size, void *ctx);
5660

0 commit comments

Comments
 (0)