Skip to content

Conversation

@victor999
Copy link

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

@pcppcp
Copy link
Contributor

pcppcp commented Nov 1, 2018

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?

@victor999
Copy link
Author

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?

@pcppcp
Copy link
Contributor

pcppcp commented Nov 1, 2018

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants