anyl-wallet
anyl-wallet copied to clipboard
Implement zephyr logger
Using zephyr logger: #include <logging/log.h> LOG_MODULE_REGISTER(foo); /* One per given log_module_name */ LOG_ERR - Level 1 LOG_WRN - Level 2 LOG_INF - Level 3 LOG_DBG - Level 4 Or LOG_HEXDUMP_ERR... and so on
Good. As I found out yesterday, there's another function that suits the output of shell submodules better (fprintf_shell()
) - my bad.
Could you continue by adding a logger to the zephyr/web3_rpc
and update some of the submodules' logging to use fprintf
(see zephyr/erc20_shell.c
for example)? The general idea is to use the logger for services that run as a background threads/libraries, and fprintf for the shell.
By the way, are you using NRF52 target or QEMU?
So you want to use logger (log.h) for the background threads, but for the shell submodules use fprintf_shell(), correct? I use NRF52 target (nrf52840 dk), but I guess I need to use qemu as well. May I use qemu that comes with Ubuntu 18.04 or I should compile it from source?
yes that's correct. You can use qemu from your distribution, I use -DBOARD=qemu_x86
as the target and it works just fine.