From 1a3da518f6c1b7c9c9787f71a7ac9484cb4c52c3 Mon Sep 17 00:00:00 2001 From: Dave Marco Date: Sat, 9 Nov 2024 21:46:29 +0000 Subject: [PATCH 01/22] add new class --- src/clp_ffi_js/ir/LogEventWithFilterData.hpp | 41 +++++++++++++++++++ src/clp_ffi_js/ir/LogEventWithLevel.hpp | 41 ------------------- .../ir/UnstructuredIrStreamReader.cpp | 28 +++++++------ .../ir/UnstructuredIrStreamReader.hpp | 5 ++- 4 files changed, 59 insertions(+), 56 deletions(-) create mode 100644 src/clp_ffi_js/ir/LogEventWithFilterData.hpp delete mode 100644 src/clp_ffi_js/ir/LogEventWithLevel.hpp diff --git a/src/clp_ffi_js/ir/LogEventWithFilterData.hpp b/src/clp_ffi_js/ir/LogEventWithFilterData.hpp new file mode 100644 index 00000000..b38437b5 --- /dev/null +++ b/src/clp_ffi_js/ir/LogEventWithFilterData.hpp @@ -0,0 +1,41 @@ +#ifndef CLP_FFI_JS_IR_LOGEVENTWITHFILTERDATA_HPP +#define CLP_FFI_JS_IR_LOGEVENTWITHFILTERDATA_HPP + +#include + +#include +#include +#include +#include + +#include + +namespace clp_ffi_js::ir { +/** + * A class which accepts a log event type as a template parameter and provides additional members + * for the log level and timestamp. The additional members facilitate log level filtering. + * @tparam LogEvent The type of the log event. + */ +template +class LogEventWithFilterData { +public: + // Constructor + explicit LogEventWithFilterData(LogEvent log_event, LogLevel log_level, clp::ir::epoch_time_ms_t timestamp) + : m_log_event{std::move(log_event)}, + m_log_level{log_level}, + m_timestamp{timestamp} {} + + [[nodiscard]] auto get_log_event() const -> LogEvent const& { return m_log_event; } + + [[nodiscard]] auto get_log_level() const -> LogLevel { return m_log_level; } + + [[nodiscard]] auto get_timestamp() const -> clp::ir::epoch_time_ms_t { return m_timestamp; } + +private: + LogEvent m_log_event; + LogLevel m_log_level; + clp::ir::epoch_time_ms_t m_timestamp; +}; +} // namespace clp_ffi_js::ir + +#endif // CLP_FFI_JS_IR_LOGEVENTWITHFILTERDATA_HPP \ No newline at end of file diff --git a/src/clp_ffi_js/ir/LogEventWithLevel.hpp b/src/clp_ffi_js/ir/LogEventWithLevel.hpp deleted file mode 100644 index 22a00af3..00000000 --- a/src/clp_ffi_js/ir/LogEventWithLevel.hpp +++ /dev/null @@ -1,41 +0,0 @@ -#ifndef CLP_FFI_JS_IR_LOGEVENTWITHLEVEL_HPP -#define CLP_FFI_JS_IR_LOGEVENTWITHLEVEL_HPP - -#include - -#include -#include -#include -#include - -#include - -namespace clp_ffi_js::ir { -/** - * A class derived from `clp::ir::LogEvent` with an additional member for the log level. - * - * NOTE: Once we move to the next IR format, this class should no longer be necessary since each - * IR log event will contain a set of key-value pairs, one of which should be the log level. - * @tparam encoded_variable_t The type of encoded variables in the event - */ -template -class LogEventWithLevel : public clp::ir::LogEvent { -public: - // Constructors - LogEventWithLevel( - clp::ir::epoch_time_ms_t timestamp, - clp::UtcOffset utc_offset, - clp::ir::EncodedTextAst message, - LogLevel log_level - ) - : clp::ir::LogEvent{timestamp, utc_offset, std::move(message)}, - m_log_level{log_level} {} - - [[nodiscard]] auto get_log_level() const -> LogLevel { return m_log_level; } - -private: - LogLevel m_log_level; -}; -} // namespace clp_ffi_js::ir - -#endif // CLP_FFI_JS_IR_LOGEVENTWITHLEVEL_HPP diff --git a/src/clp_ffi_js/ir/UnstructuredIrStreamReader.cpp b/src/clp_ffi_js/ir/UnstructuredIrStreamReader.cpp index 9a5a8f95..2cc908be 100644 --- a/src/clp_ffi_js/ir/UnstructuredIrStreamReader.cpp +++ b/src/clp_ffi_js/ir/UnstructuredIrStreamReader.cpp @@ -25,8 +25,7 @@ #include #include -#include -#include +#include "clp_ffi_js/ir/LogEventWithFilterData.hpp" #include #include @@ -147,13 +146,12 @@ auto UnstructuredIrStreamReader::deserialize_stream() -> size_t { } } - auto log_viewer_event{LogEventWithLevel( - log_event.get_timestamp(), - log_event.get_utc_offset(), - message, - log_level + auto log_event_with_filter_data{LogEventWithFilterData( + log_event, + log_level, + log_event.get_timestamp() )}; - m_encoded_log_events.emplace_back(std::move(log_viewer_event)); + m_encoded_log_events.emplace_back(std::move(log_event_with_filter_data)); } m_stream_reader_data_context.reset(nullptr); return m_encoded_log_events.size(); @@ -187,9 +185,13 @@ auto UnstructuredIrStreamReader::decode_range(size_t begin_idx, size_t end_idx, } else { log_event_idx = i; } - auto const& log_event{m_encoded_log_events[log_event_idx]}; + auto const& log_event_with_filter_data{m_encoded_log_events[log_event_idx]}; + auto const& log_level = log_event_with_filter_data.get_log_level(); + auto const& timestamp = log_event_with_filter_data.get_timestamp(); - auto const parsed{log_event.get_message().decode_and_unparse()}; + auto const& unstructured_log_event = log_event_with_filter_data.get_log_event(); + + auto const parsed{unstructured_log_event.get_message().decode_and_unparse()}; if (false == parsed.has_value()) { throw ClpFfiJsException{ clp::ErrorCode::ErrorCode_Failure, @@ -200,14 +202,14 @@ auto UnstructuredIrStreamReader::decode_range(size_t begin_idx, size_t end_idx, } message = parsed.value(); - m_ts_pattern.insert_formatted_timestamp(log_event.get_timestamp(), message); + m_ts_pattern.insert_formatted_timestamp(timestamp, message); EM_ASM( { Emval.toValue($0).push([UTF8ToString($1), $2, $3, $4]); }, results.as_handle(), message.c_str(), - log_event.get_timestamp(), - log_event.get_log_level(), + timestamp, + log_level, log_event_idx + 1 ); } diff --git a/src/clp_ffi_js/ir/UnstructuredIrStreamReader.hpp b/src/clp_ffi_js/ir/UnstructuredIrStreamReader.hpp index b4f22107..700d3b41 100644 --- a/src/clp_ffi_js/ir/UnstructuredIrStreamReader.hpp +++ b/src/clp_ffi_js/ir/UnstructuredIrStreamReader.hpp @@ -12,13 +12,14 @@ #include #include -#include +#include #include #include namespace clp_ffi_js::ir { using clp::ir::four_byte_encoded_variable_t; using UnstructuredIrDeserializer = clp::ir::LogEventDeserializer; +using UnstructuredLogEvent = clp::ir::LogEvent; /** * Mapping between an index in the filtered log events collection to an index in the unfiltered @@ -85,7 +86,7 @@ class UnstructuredIrStreamReader : public StreamReader { ); // Variables - std::vector> m_encoded_log_events; + std::vector> m_encoded_log_events; std::unique_ptr> m_stream_reader_data_context; FilteredLogEventsMap m_filtered_log_event_map; From 29a87d224cdead7d1a38ceb07a0f509ebde44fcb Mon Sep 17 00:00:00 2001 From: Dave Marco Date: Sat, 9 Nov 2024 22:41:27 +0000 Subject: [PATCH 02/22] fix-lint --- src/clp_ffi_js/ir/LogEventWithFilterData.hpp | 17 +++++++++-------- .../ir/UnstructuredIrStreamReader.cpp | 5 ++++- .../ir/UnstructuredIrStreamReader.hpp | 1 + 3 files changed, 14 insertions(+), 9 deletions(-) diff --git a/src/clp_ffi_js/ir/LogEventWithFilterData.hpp b/src/clp_ffi_js/ir/LogEventWithFilterData.hpp index b38437b5..15538a50 100644 --- a/src/clp_ffi_js/ir/LogEventWithFilterData.hpp +++ b/src/clp_ffi_js/ir/LogEventWithFilterData.hpp @@ -3,10 +3,7 @@ #include -#include -#include #include -#include #include @@ -20,10 +17,14 @@ template class LogEventWithFilterData { public: // Constructor - explicit LogEventWithFilterData(LogEvent log_event, LogLevel log_level, clp::ir::epoch_time_ms_t timestamp) - : m_log_event{std::move(log_event)}, - m_log_level{log_level}, - m_timestamp{timestamp} {} + explicit LogEventWithFilterData( + LogEvent log_event, + LogLevel log_level, + clp::ir::epoch_time_ms_t timestamp + ) + : m_log_event{std::move(log_event)}, + m_log_level{log_level}, + m_timestamp{timestamp} {} [[nodiscard]] auto get_log_event() const -> LogEvent const& { return m_log_event; } @@ -38,4 +39,4 @@ class LogEventWithFilterData { }; } // namespace clp_ffi_js::ir -#endif // CLP_FFI_JS_IR_LOGEVENTWITHFILTERDATA_HPP \ No newline at end of file +#endif // CLP_FFI_JS_IR_LOGEVENTWITHFILTERDATA_HPP diff --git a/src/clp_ffi_js/ir/UnstructuredIrStreamReader.cpp b/src/clp_ffi_js/ir/UnstructuredIrStreamReader.cpp index 2cc908be..34ed1c10 100644 --- a/src/clp_ffi_js/ir/UnstructuredIrStreamReader.cpp +++ b/src/clp_ffi_js/ir/UnstructuredIrStreamReader.cpp @@ -19,16 +19,19 @@ #include #include #include + #include #include #include #include +#include #include -#include "clp_ffi_js/ir/LogEventWithFilterData.hpp" #include #include +#include "clp_ffi_js/ir/LogEventWithFilterData.hpp" + namespace clp_ffi_js::ir { using namespace std::literals::string_literals; diff --git a/src/clp_ffi_js/ir/UnstructuredIrStreamReader.hpp b/src/clp_ffi_js/ir/UnstructuredIrStreamReader.hpp index 700d3b41..af1c9a31 100644 --- a/src/clp_ffi_js/ir/UnstructuredIrStreamReader.hpp +++ b/src/clp_ffi_js/ir/UnstructuredIrStreamReader.hpp @@ -12,6 +12,7 @@ #include #include +#include #include #include #include From e5a8e4c0435e0c46c000df4db31c4687ec0075ad Mon Sep 17 00:00:00 2001 From: Dave Marco Date: Sat, 9 Nov 2024 22:41:54 +0000 Subject: [PATCH 03/22] fix lint --- src/clp_ffi_js/ir/UnstructuredIrStreamReader.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/clp_ffi_js/ir/UnstructuredIrStreamReader.cpp b/src/clp_ffi_js/ir/UnstructuredIrStreamReader.cpp index 34ed1c10..869bb80e 100644 --- a/src/clp_ffi_js/ir/UnstructuredIrStreamReader.cpp +++ b/src/clp_ffi_js/ir/UnstructuredIrStreamReader.cpp @@ -19,14 +19,13 @@ #include #include #include - #include #include #include #include -#include #include +#include #include #include From 921c32271ed003bdf13d78be09c7c1ec7bb864c5 Mon Sep 17 00:00:00 2001 From: Dave Marco Date: Sat, 9 Nov 2024 23:21:59 +0000 Subject: [PATCH 04/22] small change --- src/clp_ffi_js/ir/LogEventWithFilterData.hpp | 11 +++++++++++ src/clp_ffi_js/ir/UnstructuredIrStreamReader.cpp | 2 +- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/src/clp_ffi_js/ir/LogEventWithFilterData.hpp b/src/clp_ffi_js/ir/LogEventWithFilterData.hpp index 15538a50..7ee77703 100644 --- a/src/clp_ffi_js/ir/LogEventWithFilterData.hpp +++ b/src/clp_ffi_js/ir/LogEventWithFilterData.hpp @@ -26,6 +26,17 @@ class LogEventWithFilterData { m_log_level{log_level}, m_timestamp{timestamp} {} + // Disable copy constructor and assignment operator + LogEventWithFilterData(LogEventWithFilterData const&) = delete; + auto operator=(LogEventWithFilterData const&) -> LogEventWithFilterData& = delete; + + // Default move constructor and assignment operator + LogEventWithFilterData(LogEventWithFilterData&&) = default; + auto operator=(LogEventWithFilterData&&) -> LogEventWithFilterData& = default; + + // Destructor + ~LogEventWithFilterData() = default; + [[nodiscard]] auto get_log_event() const -> LogEvent const& { return m_log_event; } [[nodiscard]] auto get_log_level() const -> LogLevel { return m_log_level; } diff --git a/src/clp_ffi_js/ir/UnstructuredIrStreamReader.cpp b/src/clp_ffi_js/ir/UnstructuredIrStreamReader.cpp index 869bb80e..b6bb6420 100644 --- a/src/clp_ffi_js/ir/UnstructuredIrStreamReader.cpp +++ b/src/clp_ffi_js/ir/UnstructuredIrStreamReader.cpp @@ -26,10 +26,10 @@ #include #include +#include "clp_ffi_js/ir/LogEventWithFilterData.hpp" #include #include -#include "clp_ffi_js/ir/LogEventWithFilterData.hpp" namespace clp_ffi_js::ir { From 865e41d33b6e91a9a380eb28cb83f1d1f5df4019 Mon Sep 17 00:00:00 2001 From: Dave Marco Date: Sat, 9 Nov 2024 23:26:27 +0000 Subject: [PATCH 05/22] small change --- src/clp_ffi_js/ir/UnstructuredIrStreamReader.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/clp_ffi_js/ir/UnstructuredIrStreamReader.cpp b/src/clp_ffi_js/ir/UnstructuredIrStreamReader.cpp index b6bb6420..cf3e3c33 100644 --- a/src/clp_ffi_js/ir/UnstructuredIrStreamReader.cpp +++ b/src/clp_ffi_js/ir/UnstructuredIrStreamReader.cpp @@ -26,7 +26,7 @@ #include #include -#include "clp_ffi_js/ir/LogEventWithFilterData.hpp" +#include #include #include From 0234365078c849358f2bae57e1388c9e743f0638 Mon Sep 17 00:00:00 2001 From: Dave Marco Date: Sat, 9 Nov 2024 23:37:25 +0000 Subject: [PATCH 06/22] fix lint --- src/clp_ffi_js/ir/UnstructuredIrStreamReader.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/clp_ffi_js/ir/UnstructuredIrStreamReader.cpp b/src/clp_ffi_js/ir/UnstructuredIrStreamReader.cpp index cf3e3c33..9f027def 100644 --- a/src/clp_ffi_js/ir/UnstructuredIrStreamReader.cpp +++ b/src/clp_ffi_js/ir/UnstructuredIrStreamReader.cpp @@ -30,7 +30,6 @@ #include #include - namespace clp_ffi_js::ir { using namespace std::literals::string_literals; From 0c86cf46bd73032c9e18e5f033689b65ff42e25e Mon Sep 17 00:00:00 2001 From: davemarco <83603688+davemarco@users.noreply.github.com> Date: Sat, 9 Nov 2024 18:50:37 -0500 Subject: [PATCH 07/22] Update src/clp_ffi_js/ir/LogEventWithFilterData.hpp Co-authored-by: Junhao Liao --- src/clp_ffi_js/ir/LogEventWithFilterData.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/clp_ffi_js/ir/LogEventWithFilterData.hpp b/src/clp_ffi_js/ir/LogEventWithFilterData.hpp index 7ee77703..e1007b59 100644 --- a/src/clp_ffi_js/ir/LogEventWithFilterData.hpp +++ b/src/clp_ffi_js/ir/LogEventWithFilterData.hpp @@ -17,7 +17,7 @@ template class LogEventWithFilterData { public: // Constructor - explicit LogEventWithFilterData( + LogEventWithFilterData( LogEvent log_event, LogLevel log_level, clp::ir::epoch_time_ms_t timestamp From 84037cf1816bcae24dfe9a0c96a600117a1e4063 Mon Sep 17 00:00:00 2001 From: Dave Marco Date: Sun, 10 Nov 2024 00:17:13 +0000 Subject: [PATCH 08/22] fix lint --- src/clp_ffi_js/ir/UnstructuredIrStreamReader.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/clp_ffi_js/ir/UnstructuredIrStreamReader.hpp b/src/clp_ffi_js/ir/UnstructuredIrStreamReader.hpp index af1c9a31..55adf2b9 100644 --- a/src/clp_ffi_js/ir/UnstructuredIrStreamReader.hpp +++ b/src/clp_ffi_js/ir/UnstructuredIrStreamReader.hpp @@ -8,6 +8,7 @@ #include #include +#include #include #include #include From ef1ff5db8c9de64c764a36cc1cb4222ab9e4f23b Mon Sep 17 00:00:00 2001 From: Dave Marco Date: Sun, 10 Nov 2024 00:19:36 +0000 Subject: [PATCH 09/22] fix lint --- src/clp_ffi_js/ir/UnstructuredIrStreamReader.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/clp_ffi_js/ir/UnstructuredIrStreamReader.hpp b/src/clp_ffi_js/ir/UnstructuredIrStreamReader.hpp index 55adf2b9..77cce568 100644 --- a/src/clp_ffi_js/ir/UnstructuredIrStreamReader.hpp +++ b/src/clp_ffi_js/ir/UnstructuredIrStreamReader.hpp @@ -7,8 +7,8 @@ #include #include -#include #include +#include #include #include #include From cdcad949c28c8970157389907892428af32780ba Mon Sep 17 00:00:00 2001 From: Dave Marco Date: Sun, 10 Nov 2024 00:30:22 +0000 Subject: [PATCH 10/22] fix lint --- src/clp_ffi_js/ir/UnstructuredIrStreamReader.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/clp_ffi_js/ir/UnstructuredIrStreamReader.cpp b/src/clp_ffi_js/ir/UnstructuredIrStreamReader.cpp index 9f027def..d96661ed 100644 --- a/src/clp_ffi_js/ir/UnstructuredIrStreamReader.cpp +++ b/src/clp_ffi_js/ir/UnstructuredIrStreamReader.cpp @@ -25,7 +25,6 @@ #include #include -#include #include #include #include From a1e91428f3beac677a1d8b42e456128c655d6136 Mon Sep 17 00:00:00 2001 From: Dave Marco Date: Sun, 10 Nov 2024 01:08:34 +0000 Subject: [PATCH 11/22] fix lint --- src/clp_ffi_js/ir/UnstructuredIrStreamReader.hpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/clp_ffi_js/ir/UnstructuredIrStreamReader.hpp b/src/clp_ffi_js/ir/UnstructuredIrStreamReader.hpp index 77cce568..108ca157 100644 --- a/src/clp_ffi_js/ir/UnstructuredIrStreamReader.hpp +++ b/src/clp_ffi_js/ir/UnstructuredIrStreamReader.hpp @@ -13,7 +13,6 @@ #include #include -#include #include #include #include From 8ae1fa2965f2ec0d267b5fe34f0c5a1e597e509d Mon Sep 17 00:00:00 2001 From: Dave Marco Date: Sun, 10 Nov 2024 01:20:33 +0000 Subject: [PATCH 12/22] attempt to fix lint --- src/clp_ffi_js/ir/UnstructuredIrStreamReader.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/clp_ffi_js/ir/UnstructuredIrStreamReader.cpp b/src/clp_ffi_js/ir/UnstructuredIrStreamReader.cpp index d96661ed..9f027def 100644 --- a/src/clp_ffi_js/ir/UnstructuredIrStreamReader.cpp +++ b/src/clp_ffi_js/ir/UnstructuredIrStreamReader.cpp @@ -25,6 +25,7 @@ #include #include +#include #include #include #include From 316711119bf98c4d2d48a798aff8651f8bff23a6 Mon Sep 17 00:00:00 2001 From: davemarco <83603688+davemarco@users.noreply.github.com> Date: Sun, 10 Nov 2024 15:58:23 -0500 Subject: [PATCH 13/22] Update src/clp_ffi_js/ir/LogEventWithFilterData.hpp Co-authored-by: kirkrodrigues <2454684+kirkrodrigues@users.noreply.github.com> --- src/clp_ffi_js/ir/LogEventWithFilterData.hpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/clp_ffi_js/ir/LogEventWithFilterData.hpp b/src/clp_ffi_js/ir/LogEventWithFilterData.hpp index e1007b59..3785d83b 100644 --- a/src/clp_ffi_js/ir/LogEventWithFilterData.hpp +++ b/src/clp_ffi_js/ir/LogEventWithFilterData.hpp @@ -9,8 +9,10 @@ namespace clp_ffi_js::ir { /** - * A class which accepts a log event type as a template parameter and provides additional members - * for the log level and timestamp. The additional members facilitate log level filtering. + * A templated class that extends a log event type with processed versions of some of its fields, + * specifically the fields that are used for filtering in the `StreamReader` classes and their + * callers. + * * @tparam LogEvent The type of the log event. */ template From f3862fe5ca1ecf70e9648d34029ee56065acaf99 Mon Sep 17 00:00:00 2001 From: Dave Marco Date: Sun, 10 Nov 2024 20:58:04 +0000 Subject: [PATCH 14/22] add concept --- src/clp_ffi_js/ir/LogEventWithFilterData.hpp | 10 ++++++++++ src/clp_ffi_js/ir/UnstructuredIrStreamReader.hpp | 1 - 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/clp_ffi_js/ir/LogEventWithFilterData.hpp b/src/clp_ffi_js/ir/LogEventWithFilterData.hpp index 3785d83b..c5cc8c77 100644 --- a/src/clp_ffi_js/ir/LogEventWithFilterData.hpp +++ b/src/clp_ffi_js/ir/LogEventWithFilterData.hpp @@ -4,10 +4,19 @@ #include #include +#include #include namespace clp_ffi_js::ir { +using clp::ir::four_byte_encoded_variable_t; +using UnstructuredLogEvent = clp::ir::LogEvent; + +// Concept defining valid log event types. +// TODO: Extend valid log event types when filtering support is added for structured logs. +template +concept validLogEventTypes = std::same_as; + /** * A templated class that extends a log event type with processed versions of some of its fields, * specifically the fields that are used for filtering in the `StreamReader` classes and their @@ -16,6 +25,7 @@ namespace clp_ffi_js::ir { * @tparam LogEvent The type of the log event. */ template +requires validLogEventTypes class LogEventWithFilterData { public: // Constructor diff --git a/src/clp_ffi_js/ir/UnstructuredIrStreamReader.hpp b/src/clp_ffi_js/ir/UnstructuredIrStreamReader.hpp index 108ca157..5d208c97 100644 --- a/src/clp_ffi_js/ir/UnstructuredIrStreamReader.hpp +++ b/src/clp_ffi_js/ir/UnstructuredIrStreamReader.hpp @@ -20,7 +20,6 @@ namespace clp_ffi_js::ir { using clp::ir::four_byte_encoded_variable_t; using UnstructuredIrDeserializer = clp::ir::LogEventDeserializer; -using UnstructuredLogEvent = clp::ir::LogEvent; /** * Mapping between an index in the filtered log events collection to an index in the unfiltered From 04ea35bd66e2d28f09e225bbb7a33a65da6c8ac0 Mon Sep 17 00:00:00 2001 From: Dave Marco Date: Sun, 10 Nov 2024 21:26:20 +0000 Subject: [PATCH 15/22] move function upward --- src/clp_ffi_js/ir/UnstructuredIrStreamReader.cpp | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/clp_ffi_js/ir/UnstructuredIrStreamReader.cpp b/src/clp_ffi_js/ir/UnstructuredIrStreamReader.cpp index 9f027def..395d1b45 100644 --- a/src/clp_ffi_js/ir/UnstructuredIrStreamReader.cpp +++ b/src/clp_ffi_js/ir/UnstructuredIrStreamReader.cpp @@ -187,11 +187,10 @@ auto UnstructuredIrStreamReader::decode_range(size_t begin_idx, size_t end_idx, log_event_idx = i; } auto const& log_event_with_filter_data{m_encoded_log_events[log_event_idx]}; + auto const& unstructured_log_event = log_event_with_filter_data.get_log_event(); auto const& log_level = log_event_with_filter_data.get_log_level(); auto const& timestamp = log_event_with_filter_data.get_timestamp(); - auto const& unstructured_log_event = log_event_with_filter_data.get_log_event(); - auto const parsed{unstructured_log_event.get_message().decode_and_unparse()}; if (false == parsed.has_value()) { throw ClpFfiJsException{ From 84c56112bf5b40340aba594afd9518f354d7dde4 Mon Sep 17 00:00:00 2001 From: Dave Marco Date: Sun, 10 Nov 2024 21:28:04 +0000 Subject: [PATCH 16/22] fix lint --- src/clp_ffi_js/ir/LogEventWithFilterData.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/clp_ffi_js/ir/LogEventWithFilterData.hpp b/src/clp_ffi_js/ir/LogEventWithFilterData.hpp index c5cc8c77..073c1290 100644 --- a/src/clp_ffi_js/ir/LogEventWithFilterData.hpp +++ b/src/clp_ffi_js/ir/LogEventWithFilterData.hpp @@ -3,8 +3,8 @@ #include -#include #include +#include #include From cb57bc4e4a18ef509d06bed300967eb4301cb253 Mon Sep 17 00:00:00 2001 From: Dave Marco Date: Sun, 10 Nov 2024 21:30:01 +0000 Subject: [PATCH 17/22] remove header --- src/clp_ffi_js/ir/UnstructuredIrStreamReader.hpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/clp_ffi_js/ir/UnstructuredIrStreamReader.hpp b/src/clp_ffi_js/ir/UnstructuredIrStreamReader.hpp index 5d208c97..20137c39 100644 --- a/src/clp_ffi_js/ir/UnstructuredIrStreamReader.hpp +++ b/src/clp_ffi_js/ir/UnstructuredIrStreamReader.hpp @@ -7,7 +7,6 @@ #include #include -#include #include #include #include From 5bdab3c0e32eac211183baf8fd2a0a2c739ca442 Mon Sep 17 00:00:00 2001 From: Dave Marco Date: Sun, 10 Nov 2024 21:57:10 +0000 Subject: [PATCH 18/22] small change --- src/clp_ffi_js/ir/LogEventWithFilterData.hpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/clp_ffi_js/ir/LogEventWithFilterData.hpp b/src/clp_ffi_js/ir/LogEventWithFilterData.hpp index 073c1290..681749ed 100644 --- a/src/clp_ffi_js/ir/LogEventWithFilterData.hpp +++ b/src/clp_ffi_js/ir/LogEventWithFilterData.hpp @@ -1,6 +1,7 @@ #ifndef CLP_FFI_JS_IR_LOGEVENTWITHFILTERDATA_HPP #define CLP_FFI_JS_IR_LOGEVENTWITHFILTERDATA_HPP +#include #include #include @@ -15,7 +16,7 @@ using UnstructuredLogEvent = clp::ir::LogEvent; // Concept defining valid log event types. // TODO: Extend valid log event types when filtering support is added for structured logs. template -concept validLogEventTypes = std::same_as; +concept ValidLogEventTypes = std::same_as; /** * A templated class that extends a log event type with processed versions of some of its fields, @@ -25,7 +26,7 @@ concept validLogEventTypes = std::same_as; * @tparam LogEvent The type of the log event. */ template -requires validLogEventTypes +requires ValidLogEventTypes class LogEventWithFilterData { public: // Constructor From d48e19145b315ebb74da5e276cf00f1ad3607f55 Mon Sep 17 00:00:00 2001 From: Dave Marco Date: Mon, 11 Nov 2024 03:38:39 +0000 Subject: [PATCH 19/22] kirk change --- src/clp_ffi_js/ir/UnstructuredIrStreamReader.cpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/clp_ffi_js/ir/UnstructuredIrStreamReader.cpp b/src/clp_ffi_js/ir/UnstructuredIrStreamReader.cpp index 395d1b45..37363fd0 100644 --- a/src/clp_ffi_js/ir/UnstructuredIrStreamReader.cpp +++ b/src/clp_ffi_js/ir/UnstructuredIrStreamReader.cpp @@ -147,12 +147,7 @@ auto UnstructuredIrStreamReader::deserialize_stream() -> size_t { } } - auto log_event_with_filter_data{LogEventWithFilterData( - log_event, - log_level, - log_event.get_timestamp() - )}; - m_encoded_log_events.emplace_back(std::move(log_event_with_filter_data)); + m_encoded_log_events.emplace_back(log_event, log_level, log_event.get_timestamp()); } m_stream_reader_data_context.reset(nullptr); return m_encoded_log_events.size(); From 43043258d4141d41242962ea5b6c70b0ba3656f0 Mon Sep 17 00:00:00 2001 From: Dave Marco Date: Mon, 11 Nov 2024 16:09:30 +0000 Subject: [PATCH 20/22] kirk change --- src/clp_ffi_js/ir/LogEventWithFilterData.hpp | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/clp_ffi_js/ir/LogEventWithFilterData.hpp b/src/clp_ffi_js/ir/LogEventWithFilterData.hpp index 681749ed..1ff5f07b 100644 --- a/src/clp_ffi_js/ir/LogEventWithFilterData.hpp +++ b/src/clp_ffi_js/ir/LogEventWithFilterData.hpp @@ -13,11 +13,6 @@ namespace clp_ffi_js::ir { using clp::ir::four_byte_encoded_variable_t; using UnstructuredLogEvent = clp::ir::LogEvent; -// Concept defining valid log event types. -// TODO: Extend valid log event types when filtering support is added for structured logs. -template -concept ValidLogEventTypes = std::same_as; - /** * A templated class that extends a log event type with processed versions of some of its fields, * specifically the fields that are used for filtering in the `StreamReader` classes and their @@ -26,7 +21,7 @@ concept ValidLogEventTypes = std::same_as; * @tparam LogEvent The type of the log event. */ template -requires ValidLogEventTypes +requires std::same_as class LogEventWithFilterData { public: // Constructor From 6936edba5fffc4b8573d6f59e638d510ac8774a8 Mon Sep 17 00:00:00 2001 From: Dave Marco Date: Mon, 11 Nov 2024 16:16:43 +0000 Subject: [PATCH 21/22] remove header --- src/clp_ffi_js/ir/LogEventWithFilterData.hpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/clp_ffi_js/ir/LogEventWithFilterData.hpp b/src/clp_ffi_js/ir/LogEventWithFilterData.hpp index 1ff5f07b..bd182f9b 100644 --- a/src/clp_ffi_js/ir/LogEventWithFilterData.hpp +++ b/src/clp_ffi_js/ir/LogEventWithFilterData.hpp @@ -1,7 +1,6 @@ #ifndef CLP_FFI_JS_IR_LOGEVENTWITHFILTERDATA_HPP #define CLP_FFI_JS_IR_LOGEVENTWITHFILTERDATA_HPP -#include #include #include From 53544ed9de6af465449297cc4da186d99ea575ef Mon Sep 17 00:00:00 2001 From: Dave Marco Date: Mon, 11 Nov 2024 18:14:36 +0000 Subject: [PATCH 22/22] added missing header clang said to remove... --- src/clp_ffi_js/ir/LogEventWithFilterData.hpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/clp_ffi_js/ir/LogEventWithFilterData.hpp b/src/clp_ffi_js/ir/LogEventWithFilterData.hpp index bd182f9b..1ff5f07b 100644 --- a/src/clp_ffi_js/ir/LogEventWithFilterData.hpp +++ b/src/clp_ffi_js/ir/LogEventWithFilterData.hpp @@ -1,6 +1,7 @@ #ifndef CLP_FFI_JS_IR_LOGEVENTWITHFILTERDATA_HPP #define CLP_FFI_JS_IR_LOGEVENTWITHFILTERDATA_HPP +#include #include #include