Here are a few simple examples that I use in practice. In both examples (synchronous and asynchronous) output can be seen as follows:
[2025-05-14 16:15:09.325792] [0x0000007f7f94f180] [debug] data: 0x7e
[2025-05-14 16:15:09.342615] [0x0000007f7f94f180] [debug] data: 0x5b 0
[2025-05-14 16:15:09.343628] [0x0000007f7f94f180] [debug] data: 0x70 1
[2025-05-14 16:15:09.358392] [0x0000007f7f94f180] [debug] data: 0x5b 0
[2025-05-14 16:15:09.358617] [0x0000007f7f94f180] [debug] data: 0x7a 1
[2025-05-14 16:15:09.374358] [0x0000007f7f94f180] [debug] data: 0x5b 0
[2025-05-14 16:15:09.374516] [0x0000007f7f94f180] [debug] data: 0x79 1