path BUGFIX keep previous logging info
diff --git a/src/path.c b/src/path.c
index bceb3ef..bc4552a 100644
--- a/src/path.c
+++ b/src/path.c
@@ -860,7 +860,7 @@
/* remember original context node */
cur_node = ctx_node;
- LOG_LOCINIT(cur_node, NULL, NULL, NULL);
+ LOG_LOCSET(cur_node, NULL, NULL, NULL);
if (oper == LY_PATH_OPER_OUTPUT) {
getnext_opts = LYS_GETNEXT_OUTPUT;
diff --git a/tests/utests/extensions/test_schema_mount.c b/tests/utests/extensions/test_schema_mount.c
index 381648a..130268c 100644
--- a/tests/utests/extensions/test_schema_mount.c
+++ b/tests/utests/extensions/test_schema_mount.c
@@ -296,9 +296,9 @@
" <module-set-id>1</module-set-id>"
"</modules-state>");
CHECK_PARSE_LYD_PARAM(xml, LYD_XML, LYD_PARSE_STRICT, LYD_VALIDATE_PRESENT, LY_EVALID, data);
- CHECK_LOG_CTX("Node \"interfaces\" not found as a child of \"root\" node.", NULL);
+ CHECK_LOG_CTX("Node \"interfaces\" not found as a child of \"root\" node.", "Line number 1.");
CHECK_PARSE_LYD_PARAM(json, LYD_JSON, LYD_PARSE_STRICT, LYD_VALIDATE_PRESENT, LY_EVALID, data);
- CHECK_LOG_CTX("Node \"interfaces\" not found as a child of \"root\" node.", NULL);
+ CHECK_LOG_CTX("Node \"interfaces\" not found as a child of \"root\" node.", "Line number 1.");
/* missing module in yang-library data */
ly_ctx_set_ext_data_clb(UTEST_LYCTX, test_ext_data_clb,
@@ -337,9 +337,9 @@
" </mount-point>"
"</schema-mounts>");
CHECK_PARSE_LYD_PARAM(xml, LYD_XML, LYD_PARSE_STRICT, LYD_VALIDATE_PRESENT, LY_EVALID, data);
- CHECK_LOG_CTX("Node \"interfaces\" not found as a child of \"root\" node.", NULL);
+ CHECK_LOG_CTX("Node \"interfaces\" not found as a child of \"root\" node.", "Line number 1.");
CHECK_PARSE_LYD_PARAM(json, LYD_JSON, LYD_PARSE_STRICT, LYD_VALIDATE_PRESENT, LY_EVALID, data);
- CHECK_LOG_CTX("Node \"interfaces\" not found as a child of \"root\" node.", NULL);
+ CHECK_LOG_CTX("Node \"interfaces\" not found as a child of \"root\" node.", "Line number 1.");
/* callback data correct, invalid YANG data */
ly_ctx_set_ext_data_clb(UTEST_LYCTX, test_ext_data_clb,
@@ -409,7 +409,7 @@
CHECK_PARSE_LYD_PARAM(json, LYD_JSON, LYD_PARSE_STRICT, LYD_VALIDATE_PRESENT, LY_EVALID, data);
CHECK_LOG_CTX("Extension plugin \"libyang 2 - Schema Mount, version 1\": "
"Mandatory node \"type\" instance does not exist.",
- "Schema location \"/ietf-interfaces:interfaces/interface/type\".");
+ "Schema location \"/ietf-interfaces:interfaces/interface/type\", line number 1.");
/* same validation fail in separate validation */
CHECK_PARSE_LYD_PARAM(xml, LYD_XML, LYD_PARSE_STRICT | LYD_PARSE_ONLY, 0, LY_SUCCESS, data);
@@ -1149,7 +1149,7 @@
CHECK_LOG_CTX("Extension plugin \"libyang 2 - Schema Mount, version 1\": "
"Invalid leafref value \"target-value\" - no existing target instance \"/sm:target\".",
"Schema location \"/ietf-interfaces:interfaces/interface/sm:sm-name\", "
- "data location \"/ietf-interfaces:interfaces/interface[name='bu']/sm:sm-name\".");
+ "data location \"/ietf-interfaces:interfaces/interface[name='bu']/sm:sm-name\", line number 18.");
/* success */
xml =
diff --git a/tests/utests/types/instanceid.c b/tests/utests/types/instanceid.c
index 9d471c9..8b46aaa 100644
--- a/tests/utests/types/instanceid.c
+++ b/tests/utests/types/instanceid.c
@@ -137,7 +137,7 @@
"<list xmlns=\"urn:tests:defs\"><id>b</id><value>x</value></list>",
"defs", "xmlns:xdf=\"urn:tests:defs\"", "xdf:l1", "/xdf:list[2]/xdf:value", LY_EVALID);
CHECK_LOG_CTX("Invalid instance-identifier \"/xdf:list[2]/xdf:value\" value - semantic error.",
- "Schema location \"/defs:l1\".");
+ "Schema location \"/defs:l1\", line number 1.");
TEST_ERROR_XML2("",
"defs", "xmlns:xdf=\"urn:tests:defs\"", "xdf:l1", "/t:cont/t:1l", LY_EVALID);
@@ -152,7 +152,7 @@
TEST_ERROR_XML2("",
"defs", "xmlns:xdf=\"urn:tests:defs\"", "xdf:l1", "/xdf:cont/xdf:invalid/xdf:path", LY_EVALID);
CHECK_LOG_CTX("Invalid instance-identifier \"/xdf:cont/xdf:invalid/xdf:path\" value - semantic error.",
- "Schema location \"/defs:l1\".");
+ "Schema location \"/defs:l1\", line number 1.");
/* non-existing instances, instance-identifier is here in JSON format because it is already in internal
* representation without canonical prefixes */
@@ -196,7 +196,7 @@
TEST_ERROR_XML2("<cont xmlns=\"urn:tests:mod\"/>",
"defs", "xmlns:m=\"urn:tests:mod\"", "l1", "/m:cont[1]", LY_EVALID);
CHECK_LOG_CTX("Invalid instance-identifier \"/m:cont[1]\" value - semantic error.",
- "Schema location \"/defs:l1\".");
+ "Schema location \"/defs:l1\", line number 1.");
TEST_ERROR_XML2("<cont xmlns=\"urn:tests:mod\"/>",
"defs", "xmlns:m=\"urn:tests:mod\"", "l1", "[1]", LY_EVALID);
@@ -211,32 +211,32 @@
TEST_ERROR_XML2("<cont xmlns=\"urn:tests:mod\"><l2/></cont>",
"defs", "xmlns:m=\"urn:tests:mod\"", "l1", "/m:cont/m:l2[m:l2='1']", LY_EVALID);
CHECK_LOG_CTX("Invalid instance-identifier \"/m:cont/m:l2[m:l2='1']\" value - semantic error.",
- "Schema location \"/defs:l1\".");
+ "Schema location \"/defs:l1\", line number 1.");
TEST_ERROR_XML2("<llist xmlns=\"urn:tests:defs\">1</llist><llist xmlns=\"urn:tests:defs\">2</llist>",
"defs", "xmlns:t=\"urn:tests:defs\"", "t:l1", "/t:llist[4]", LY_EVALID);
CHECK_LOG_CTX("Invalid instance-identifier \"/t:llist[4]\" value - semantic error.",
- "Schema location \"/defs:l1\".");
+ "Schema location \"/defs:l1\", line number 1.");
TEST_ERROR_XML2("",
"defs", "xmlns:xdf=\"urn:tests:defs\"", "xdf:l2", "/t:llist[6]", LY_EVALID);
CHECK_LOG_CTX("Invalid instance-identifier \"/t:llist[6]\" value - semantic error.",
- "Schema location \"/defs:l2\".");
+ "Schema location \"/defs:l2\", line number 1.");
TEST_ERROR_XML2("<list xmlns=\"urn:tests:defs\"><id>1</id><value>x</value></list>",
"defs", "xmlns:xdf=\"urn:tests:defs\"", "xdf:l2", "/xdf:list[xdf:value='x']", LY_EVALID);
CHECK_LOG_CTX("Invalid instance-identifier \"/xdf:list[xdf:value='x']\" value - semantic error.",
- "Schema location \"/defs:l2\".");
+ "Schema location \"/defs:l2\", line number 1.");
TEST_ERROR_XML2("",
"defs", "xmlns:xdf=\"urn:tests:defs\"", "xdf:l2", "/xdf:list[.='x']", LY_EVALID);
CHECK_LOG_CTX("Invalid instance-identifier \"/xdf:list[.='x']\" value - semantic error.",
- "Schema location \"/defs:l2\".");
+ "Schema location \"/defs:l2\", line number 1.");
TEST_ERROR_XML2("<llist xmlns=\"urn:tests:defs\">1</llist>",
"defs", "xmlns:t=\"urn:tests:defs\"", "t:l1", "/t:llist[.='x']", LY_EVALID);
CHECK_LOG_CTX("Invalid instance-identifier \"/t:llist[.='x']\" value - semantic error.",
- "Schema location \"/defs:l1\".");
+ "Schema location \"/defs:l1\", line number 1.");
TEST_ERROR_XML2("",
"defs", "xmlns:xdf=\"urn:tests:defs\"", "xdf:l2", "/t:llist[1][2]", LY_EVALID);
@@ -256,7 +256,7 @@
TEST_ERROR_XML2("",
"defs", "xmlns:xdf=\"urn:tests:defs\"", "xdf:l2", "/xdf:list2[xdf:id='1']/xdf:value", LY_EVALID);
CHECK_LOG_CTX("Invalid instance-identifier \"/xdf:list2[xdf:id='1']/xdf:value\" value - semantic error.",
- "Schema location \"/defs:l2\".");
+ "Schema location \"/defs:l2\", line number 1.");
}
static void