RFC: Stopping Zephyr networking from being painful by enabling error logging by default


Paul Sokolovsky
 

Hello,

I more the once mentioned the issue that Zephyr IP networking is very
hard to configure. It almost impossible to configure
a slightly-above-trivial app from scratch: something won't work with it,
usually silently.

A usual response would be "enable debug logging", but here it goes in
the vicious cycle, because it's hard to enable network debug logging in
Zephyr. It requires setting CONFIG_NET_LOG, then if you're lucky, you
discover CONFIG_NET_LOG_GLOBAL, then you also need to figure out that
you need to set CONFIG_SYS_LOG_NET_LEVEL to a cryptic numeric value.

If you think that's enough, then nah, because CONFIG_NET_LOG_GLOBAL
doesn't really enable logging globally. Then maybe you trace another
config option, after which you will likely either get a flood of DEBUG
level logging, or find out that an important condition is not logged at
all.

Debugging the configuration and debug logging itself is quite painful,
after a year on Zephyr, I still didn't master it, what to say about
newcomers?

So, I'd like to propose to make following changes:

1. Enable CONFIG_NET_LOG=y, CONFIG_NET_LOG_GLOBAL=y,
CONFIG_SYS_LOG_NET_LEVEL=2 (WARN) by default.

2. Describe (in the docs, or otherwise) that CONFIG_NET_LOG=n is the
master switch to disable all logging at once.

3. Make sure that CONFIG_NET_LOG_GLOBAL=y actually enables logging for
anything network related.

4. Make sure that any important (to user) conditions actually reported
with NET_WARN() or NET_ERR(), so will be visible to a user by default.


--
Best Regards,
Paul

Linaro.org | Open source software for ARM SoCs
Follow Linaro: http://www.facebook.com/pages/Linaro
http://twitter.com/#!/linaroorg - http://www.linaro.org/linaro-blog

Join devel@lists.zephyrproject.org to automatically receive all group messages.