1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2025-12-01 23:12:29 +02:00

sdk/log: Add options to NewSimpleProcessor (#5185)

This commit is contained in:
Robert Pająk
2024-04-10 19:47:40 +02:00
committed by GitHub
parent 727f03e220
commit 054a63fef2
3 changed files with 19 additions and 14 deletions

View File

@@ -22,7 +22,7 @@ type SimpleProcessor struct {
// showing examples of other features, but it can be slow and have a high
// computation resource usage overhead. [NewBatchingProcessor] is recommended
// for production use instead.
func NewSimpleProcessor(exporter Exporter) *SimpleProcessor {
func NewSimpleProcessor(exporter Exporter, _ ...SimpleProcessorOption) *SimpleProcessor {
if exporter == nil {
// Do not panic on nil exporter.
exporter = defaultNoopExporter
@@ -49,3 +49,8 @@ func (s *SimpleProcessor) Shutdown(ctx context.Context) error {
func (s *SimpleProcessor) ForceFlush(ctx context.Context) error {
return s.exporter.ForceFlush(ctx)
}
// SimpleProcessorOption applies a configuration to a [SimpleProcessor].
type SimpleProcessorOption interface {
apply()
}