anyl-wallet icon indicating copy to clipboard operation
anyl-wallet copied to clipboard

Implement zephyr logger

Open victor999 opened this issue 6 years ago • 3 comments

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

victor999 avatar Oct 31 '18 19:10 victor999

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?

pcppcp avatar Nov 01 '18 08:11 pcppcp

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?

victor999 avatar Nov 01 '18 09:11 victor999

yes that's correct. You can use qemu from your distribution, I use -DBOARD=qemu_x86 as the target and it works just fine.

pcppcp avatar Nov 01 '18 09:11 pcppcp