[Ovmsdev] Transition to new esp-idf
Stephen Casner
casner at acm.org
Tue Jan 16 08:03:03 HKT 2018
On Mon, 15 Jan 2018, Michael Balzer wrote:
> More issues:
>
> a) changing log levels only works without specifying a tag
There was a bug/limitation in release/v2.1 that changing the log level
for a tag did not have any effect if some log messages had already
been emitted for that tag. This was because the code created a cache
of tags and did not update the cache when the function to set the
level was called. I added code to update the cache.
When I went to merge my changes from v2.1 to v3.0 that change hit a
conflict. It looked like there was already code present that should
update the cache, although I did not study it carefully.
OK, I looked at it more closely. There is code with a comment "search
in the cache and update it if exist", but that code is doing a fast
search where it is just comparing the address of the tag string to
what it has cached, not the value of the string. This does not work
because the cached tag string comes from the source file where the
logs are generated, but the tag in the level setting command comes
from argv in ovms_command.cpp.
A workaround is that the cache is cleared when you set a level without
specifying a tag, then you can set the level for the desired tag after
that.
I can change the code in the OS again and try issuing a PR to see if
they will pick it up.
-- Steve
More information about the OvmsDev
mailing list