From 1a082a3e957bc669ae7b143e04d8d1012dddac4c Mon Sep 17 00:00:00 2001 From: Kieran Bingham <kieran.bingham@ideasonboard.com> Date: Mon, 8 Aug 2022 21:30:26 +0100 Subject: libcamera: yaml_parser: Report filename on failures It can be helpful to know 'which' file failed to parse if there is a failure. Report it to the user in the error message. Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Reviewed-by: Umang Jain <umang.jain@ideasonboard.com> --- src/libcamera/yaml_parser.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libcamera/yaml_parser.cpp b/src/libcamera/yaml_parser.cpp index 84cffd0d..d8a7c2f9 100644 --- a/src/libcamera/yaml_parser.cpp +++ b/src/libcamera/yaml_parser.cpp @@ -841,7 +841,9 @@ std::unique_ptr<YamlObject> YamlParser::parse(File &file) std::unique_ptr<YamlObject> root(new YamlObject()); if (context.parseContent(*root)) { - LOG(YamlParser, Error) << "Failed to parse YAML content"; + LOG(YamlParser, Error) + << "Failed to parse YAML content from " + << file.fileName(); return nullptr; } -- cgit v1.2.1