You've already forked opentelemetry-go
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:
@@ -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()
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user