log: allow log register API to update log level
PATCH 1/1 log: allow log register API to update log level
This commit fixes the bug in the registration API where it fails to set the log level if 'id' already exists.
Signed-off-by Bharath Paulraj <[email protected]>
--- .mailmap | 1 + lib/log/log.c | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-)
.mailmap +1 -0
@@ -181,6 +181,7 @@ Bernard Iremonger <[email protected]> Bert van Leeuwen <[email protected]> Bhagyada Modali <[email protected]> Bharat Mota <[email protected]> <[email protected]> +Bharath Paulraj <[email protected]> Bhuvan Mital <[email protected]> Bill Hong <[email protected]> Billy McFall <[email protected]>
lib/log/log.c +3 -1
@@ -292,8 +292,10 @@ log_register(const char *name, uint32_t level)int id; id =log_lookup (name); -if (id >=0 ) +if (id >=0 ) { +logtype_set_level (id, level);return id; + } new_dynamic_types = realloc(rte_logs.dynamic_types, sizeof(struct rte_log_dynamic_type) *
Signature · 1 line
2.34.1
09/08/2024 15:01, Bharath Paulraj:
Quoted 2 lines
This commit fixes the bug in the registration API where it fails to set the log level if 'id' already exists.
Why registering twice?