patches: silence libyang "Obsolete schema node" warnings in log

Fixes #1127

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg
2025-09-02 10:53:49 +02:00
parent fc7e1d0745
commit 1d0c2be515
2 changed files with 67 additions and 2 deletions
+4 -2
View File
@@ -3,7 +3,7 @@ Change Log
All notable changes to the project are documented in this file.
[v25.08.0][UNRELEASED] -
[v25.08.0][] - 2025-09-01
-------------------------
### Changes
@@ -17,6 +17,7 @@ All notable changes to the project are documented in this file.
- Fix #1123: Disabling or removing a container may cause podman to hang
- Fix #1124: Container setup with unreachable remote image spawns
excessive `ip monitor` processes
- Fix #1127: Silence libyang Obsolete schema node warnings in log
[RPI-TOUCH]: https://www.raspberrypi.com/products/raspberry-pi-touch-display/
@@ -1611,7 +1612,8 @@ Supported YANG models in addition to those used by sysrepo and netopeer:
- N/A
[buildroot]: https://buildroot.org/
[UNRELEASED]: https://github.com/kernelkit/infix/compare/v25.06.1...HEAD
[UNRELEASED]: https://github.com/kernelkit/infix/compare/v25.08.0...HEAD
[v25.08.0]: https://github.com/kernelkit/infix/compare/v25.06.1...v26.08.0
[v25.06.0]: https://github.com/kernelkit/infix/compare/v25.05.1...v26.06.0
[v25.05.1]: https://github.com/kernelkit/infix/compare/v25.05.0...v25.05.1
[v25.05.0]: https://github.com/kernelkit/infix/compare/v25.04.0...v25.05.0
@@ -0,0 +1,63 @@
From 4603d09f5d1bd9ca0a1d4467d30a71528c8e2df4 Mon Sep 17 00:00:00 2001
From: Joachim Wiberg <troglobit@gmail.com>
Date: Mon, 1 Sep 2025 14:24:03 +0200
Subject: [PATCH] lyd_validate_obsolete: change log level warning -> debug
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Organization: Wires
A library should not log directly to syslog, this is the responsibility
of the application. In our case sysrepo, with a knob to disable it when
you know what you're doing or have other ways of handling deprecated and
obsolete nodes — e.g., automatically migrating them to a new tree.
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
---
src/log.c | 3 +++
src/log.h | 1 +
src/validation.c | 2 +-
3 files changed, 5 insertions(+), 1 deletion(-)
diff --git a/src/log.c b/src/log.c
index 13da500ef..553aefe55 100644
--- a/src/log.c
+++ b/src/log.c
@@ -705,6 +705,9 @@ ly_log_dbg(uint32_t group, const char *format, ...)
case LY_LDGDEPSETS:
str_group = "DEPSETS";
break;
+ case LY_LDGSCHEMA:
+ str_group = "SCHEMA";
+ break;
default:
LOGINT(NULL);
return;
diff --git a/src/log.h b/src/log.h
index 85f2ac6d4..2bbb0b19b 100644
--- a/src/log.h
+++ b/src/log.h
@@ -156,6 +156,7 @@ LIBYANG_API_DECL uint32_t *ly_temp_log_options(uint32_t *opts);
#define LY_LDGDICT 0x01 /**< Dictionary additions and deletions. */
#define LY_LDGXPATH 0x02 /**< XPath parsing end evaluation. */
#define LY_LDGDEPSETS 0x04 /**< Dependency module sets for schema compilation. */
+#define LY_LDGSCHEMA 0x08 /**< Schema compilation and validation. */
/**
* @}
diff --git a/src/validation.c b/src/validation.c
index 25be0feeb..8e308c61f 100644
--- a/src/validation.c
+++ b/src/validation.c
@@ -1624,7 +1624,7 @@ lyd_validate_obsolete(const struct lyd_node *node)
if (snode->flags & LYS_STATUS_OBSLT &&
(!(snode->nodetype & LYD_NODE_INNER) || lyd_child(node))) {
LOG_LOCSET(NULL, node);
- LOGWRN(snode->module->ctx, "Obsolete schema node \"%s\" instantiated in data.", snode->name);
+ LOGDBG(LY_LDGSCHEMA, snode->module->ctx, "Obsolete schema node \"%s\" instantiated in data.", snode->name);
LOG_LOCBACK(0, 1);
break;
}
--
2.43.0