Class SimpleLogRecordProcessor
Defined in File simple_log_record_processor.h
Inheritance Relationships
Base Type
public opentelemetry::sdk::logs::LogRecordProcessor
(Class LogRecordProcessor)
Class Documentation
-
class SimpleLogRecordProcessor : public opentelemetry::sdk::logs::LogRecordProcessor
The simple log processor passes all log records in a batch of 1 to the configured LogRecordExporter.
All calls to the configured LogRecordExporter are synchronized using a spin-lock on an atomic_flag.
Public Functions
-
explicit SimpleLogRecordProcessor(std::unique_ptr<LogRecordExporter> &&exporter)
-
~SimpleLogRecordProcessor() override
-
virtual std::unique_ptr<Recordable> MakeRecordable() noexcept override
Create a log recordable. This requests a new log recordable from the associated exporter.
Note: This method must be callable from multiple threads.
- Returns:
a newly initialized recordable
-
virtual void OnEmit(std::unique_ptr<Recordable> &&record) noexcept override
OnEmit is called by the SDK once a log record has been successfully created.
- Parameters:
record – the log recordable object
-
virtual bool ForceFlush(std::chrono::microseconds timeout = (std::chrono::microseconds::max)()) noexcept override
Exports all log records that have not yet been exported to the configured Exporter.
- Parameters:
timeout – that the forceflush is required to finish within.
- Returns:
a result code indicating whether it succeeded, failed or timed out
-
virtual bool Shutdown(std::chrono::microseconds timeout = (std::chrono::microseconds::max)()) noexcept override
Shuts down the processor and does any cleanup required. ShutDown should only be called once for each processor.
- Parameters:
timeout – minimum amount of microseconds to wait for shutdown before giving up and returning failure.
- Returns:
true if the shutdown succeeded, false otherwise
-
bool IsShutdown() const noexcept
-
explicit SimpleLogRecordProcessor(std::unique_ptr<LogRecordExporter> &&exporter)