1
0
mirror of https://github.com/open-telemetry/opentelemetry-go.git synced 2025-11-23 22:34:47 +02:00
Files
opentelemetry-go/experimental/streaming/exporter/stdout/stdout.go
Joshua MacDonald a3ae50d8bc Remove experimental/streaming globals, add streaming example (#135)
* Remove globals from exp/streaming

* basic example

* Build the streaming example

* Update README.md for running streaming example

* Remove observer package

* Move observer to exporter

* Fix

* Re-run make circle-ci
2019-09-23 14:39:10 -07:00

34 lines
1.1 KiB
Go

// Copyright 2019, OpenTelemetry Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package stdout // import "go.opentelemetry.io/experimental/streaming/exporter/stdout"
import (
"os"
"go.opentelemetry.io/experimental/streaming/exporter"
"go.opentelemetry.io/experimental/streaming/exporter/reader"
"go.opentelemetry.io/experimental/streaming/exporter/reader/format"
)
type stdoutLog struct{}
func New() exporter.Observer {
return reader.NewReaderObserver(&stdoutLog{})
}
func (s *stdoutLog) Read(data reader.Event) {
os.Stdout.WriteString(format.EventToString(data))
}