Lora-net / SWL2001

LoRa Basics Modem LoRaWAN stack
BSD 3-Clause Clear License
87 stars 50 forks source link

`SMTC_MODEM_HAL_TRACE_PRINTF` eol #31

Closed asob closed 3 months ago

asob commented 5 months ago

Hi,

I see that library consistently utilize \n as line termination, I understand that that is okay when using the library as a standalone application without any user code or in a instance where user's eol flavour matches your \n preference. But what about system's where existing logging system has a different eol-flavor?

I would suggest adding a define in smtc_modem_hal_dbg_trace.h which allows user to modify eol flavor across all debug prints and making it easier to integrate with existing logging solutions.

Something along the lines:

#define SMTC_MODEM_HAL_EOL  "\n"  // User specified eol terminator

and then modify all SMTC_MODEM_HAL_TRACE_... to use the abovementioned eol