|
ORE Studio 0.0.4
|
Hybrid exporter that writes to file and optionally streams to server. More...
#include <hybrid_log_exporter.hpp>


Public Member Functions | |
| hybrid_log_exporter (const std::filesystem::path &file_path, telemetry_options options, send_records_callback send_callback=nullptr) | |
| Constructs a hybrid log exporter. | |
| hybrid_log_exporter (const hybrid_log_exporter &)=delete | |
| hybrid_log_exporter & | operator= (const hybrid_log_exporter &)=delete |
| void | export_record (domain::log_record record) override |
| Exports a log record. | |
| void | flush () override |
| Flushes pending records. | |
| void | shutdown () override |
| Shuts down the exporter. | |
| void | set_connected (bool connected) |
| Updates the connection status. | |
| std::uint64_t | upload_position () const |
| Returns the current upload position. | |
Hybrid exporter that writes to file and optionally streams to server.
This exporter implements a dual-export strategy:
The exporter maintains durability through:
Thread-safety: All public methods are thread-safe.
| hybrid_log_exporter | ( | const std::filesystem::path & | file_path, |
| telemetry_options | options, | ||
| send_records_callback | send_callback = nullptr |
||
| ) |
Constructs a hybrid log exporter.
| file_path | Path to the JSON Lines output file. |
| options | Telemetry configuration options. |
| send_callback | Callback for sending records to the server. May be nullptr if streaming is disabled. |
|
overridevirtual |
Exports a log record.
The record is immediately written to the file. If streaming is enabled, it is also added to the pending batch. The batch is sent when it reaches batch_size or when flush_interval has elapsed.
| record | The log record to export. |
Implements log_exporter.
|
overridevirtual |
Flushes pending records.
Forces immediate file flush and sends any pending batch to the server (if streaming is enabled and connected).
Implements log_exporter.

|
overridevirtual |
Shuts down the exporter.
Flushes pending records and stops the background flush thread.
Implements log_exporter.
| void set_connected | ( | bool | connected | ) |
Updates the connection status.
When connection becomes available after being disconnected, this triggers upload of any records that accumulated during the disconnect.
| connected | true if connection is available. |