log.go 472 B

123456789101112131415161718192021222324
  1. // Copyright The OpenTelemetry Authors
  2. // SPDX-License-Identifier: Apache-2.0
  3. package prometheusexporter // import "github.com/open-telemetry/opentelemetry-collector-contrib/exporter/prometheusexporter"
  4. import (
  5. "fmt"
  6. "go.uber.org/zap"
  7. )
  8. type promLogger struct {
  9. realLog *zap.Logger
  10. }
  11. func newPromLogger(zapLog *zap.Logger) *promLogger {
  12. return &promLogger{
  13. realLog: zapLog,
  14. }
  15. }
  16. func (l *promLogger) Println(v ...any) {
  17. l.realLog.Error(fmt.Sprintln(v...))
  18. }