From 15211e2b5cee0c3239f653363d9350370dc8de9f Mon Sep 17 00:00:00 2001 From: LinZhihao-723 Date: Fri, 28 Feb 2025 11:34:18 -0500 Subject: [PATCH] Add log statements. --- src/clp_ffi_js/ir/StructuredIrUnitHandler.cpp | 12 +++++++++++- src/clp_ffi_js/ir/StructuredIrUnitHandler.hpp | 4 ++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/clp_ffi_js/ir/StructuredIrUnitHandler.cpp b/src/clp_ffi_js/ir/StructuredIrUnitHandler.cpp index 66143db6..df93388d 100644 --- a/src/clp_ffi_js/ir/StructuredIrUnitHandler.cpp +++ b/src/clp_ffi_js/ir/StructuredIrUnitHandler.cpp @@ -179,7 +179,17 @@ auto StructuredIrUnitHandler::handle_schema_tree_node_insertion( return clp::ffi::ir_stream::IRErrorCode::IRErrorCode_Success; } -auto StructuredIrUnitHandler::handle_end_of_stream() -> clp::ffi::ir_stream::IRErrorCode { +auto StructuredIrUnitHandler::handle_end_of_stream() const -> clp::ffi::ir_stream::IRErrorCode { + if (m_optional_log_level_full_branch.has_value() + && false == m_optional_log_level_node_id.has_value()) + { + SPDLOG_WARN("Log-level filter option is given, but the key is not found in the IR stream."); + } + if (m_optional_timestamp_full_branch.has_value() + && false == m_optional_timestamp_node_id.has_value()) + { + SPDLOG_WARN("Timestamp filter option is given, but the key is not found in the IR stream."); + } return clp::ffi::ir_stream::IRErrorCode::IRErrorCode_Success; } diff --git a/src/clp_ffi_js/ir/StructuredIrUnitHandler.hpp b/src/clp_ffi_js/ir/StructuredIrUnitHandler.hpp index aaf6f0da..914f558e 100644 --- a/src/clp_ffi_js/ir/StructuredIrUnitHandler.hpp +++ b/src/clp_ffi_js/ir/StructuredIrUnitHandler.hpp @@ -133,10 +133,10 @@ class StructuredIrUnitHandler { ) -> clp::ffi::ir_stream::IRErrorCode; /** - * Dummy implementation that does nothing but conforms to the interface. + * Handles end-of-stream IR unit. * @return IRErrorCode::IRErrorCode_Success */ - [[nodiscard]] static auto handle_end_of_stream() -> clp::ffi::ir_stream::IRErrorCode; + [[nodiscard]] auto handle_end_of_stream() const -> clp::ffi::ir_stream::IRErrorCode; private: // Methods