log: track log level changes
authorDavid Marchand <david.marchand@redhat.com>
Fri, 9 Apr 2021 11:04:52 +0000 (13:04 +0200)
committerDavid Marchand <david.marchand@redhat.com>
Fri, 9 Apr 2021 12:19:53 +0000 (14:19 +0200)
commiteba022b926ff15d15d2e5ace145504e10bbfb97d
tree6b472a42bbed8c059afe626eff3381bf3d66b6c3
parent39b5717999f0b1be3ad481ccbe5185637cc1bc35
log: track log level changes

Add a log message when registering log types and changing log levels.

__rte_log_register previous handled both legacy and dynamic logtypes.
To simplify the code, __rte_log_register is reworked to only handle
dynamic logtypes and takes a log level.

Example:
$ DPDK_TEST=logs_autotest ./build/app/test/dpdk-test --no-huge -m 512 \
  --log-level=lib.eal:debug
...
RTE>>logs_autotest
== dynamic log types
EAL: logtype1 log level changed from disabled to info
EAL: logtype2 log level changed from disabled to info
EAL: logtype1 log level changed from info to error
EAL: logtype3 log level changed from error to emergency
EAL: logtype2 log level changed from info to emergency
EAL: logtype3 log level changed from emergency to debug
EAL: logtype1 log level changed from error to debug
EAL: logtype2 log level changed from emergency to debug
error message
critical message
critical message
error message
== static log types
TESTAPP1: error message
TESTAPP1: critical message
TESTAPP2: critical message
TESTAPP1: error message
Test OK

Suggested-by: Ilya Maximets <i.maximets@ovn.org>
Signed-off-by: David Marchand <david.marchand@redhat.com>
Acked-by: Andrew Rybchenko <arybchenko@solarflare.com>
Acked-by: Lukasz Wojciechowski <l.wojciechow@partner.samsung.com>
Acked-by: Thomas Monjalon <thomas@monjalon.net>
lib/librte_eal/common/eal_common_log.c