log: allow log register API to update log level
Checks
Commit Message
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 <bharathpaul@gmail.com>
---
.mailmap | 1 +
lib/log/log.c | 4 +++-
2 files changed, 4 insertions(+), 1 deletion(-)
Comments
09/08/2024 15:01, Bharath Paulraj:
> This commit fixes the bug in the registration API where it fails to
> set the log level if 'id' already exists.
Why registering twice?
@@ -181,6 +181,7 @@ Bernard Iremonger <bernard.iremonger@intel.com>
Bert van Leeuwen <bert.vanleeuwen@netronome.com>
Bhagyada Modali <bhagyada.modali@amd.com>
Bharat Mota <bharat.mota@broadcom.com> <bmota@vmware.com>
+Bharath Paulraj <bharathpaul@gmail.com>
Bhuvan Mital <bhuvan.mital@amd.com>
Bill Hong <bhong@brocade.com>
Billy McFall <bmcfall@redhat.com>
@@ -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) *