2024-02-16 17:09:58 +02:00
|
|
|
// Copyright The OpenTelemetry Authors
|
2024-02-29 08:05:28 +02:00
|
|
|
// SPDX-License-Identifier: Apache-2.0
|
2024-02-16 17:09:58 +02:00
|
|
|
|
|
|
|
package log // import "go.opentelemetry.io/otel/log"
|
|
|
|
|
2024-02-18 17:51:13 +02:00
|
|
|
import "go.opentelemetry.io/otel/log/embedded"
|
|
|
|
|
2024-02-16 17:09:58 +02:00
|
|
|
// LoggerProvider provides access to [Logger].
|
|
|
|
//
|
|
|
|
// Warning: Methods may be added to this interface in minor releases. See
|
|
|
|
// package documentation on API implementation for information on how to set
|
|
|
|
// default behavior for unimplemented methods.
|
|
|
|
type LoggerProvider interface {
|
2024-02-18 17:51:13 +02:00
|
|
|
// Users of the interface can ignore this. This embedded type is only used
|
|
|
|
// by implementations of this interface. See the "API Implementations"
|
|
|
|
// section of the package documentation for more information.
|
|
|
|
embedded.LoggerProvider
|
2024-02-16 17:09:58 +02:00
|
|
|
|
|
|
|
// Logger returns a new [Logger] with the provided name and configuration.
|
|
|
|
//
|
2024-07-12 20:28:43 +02:00
|
|
|
// The name needs to uniquely identify the source of logged code. It is
|
|
|
|
// recommended that name is the Go package name of the library using a log
|
|
|
|
// bridge (note: this is not the name of the bridge package). Most
|
|
|
|
// commonly, this means a bridge will need to accept this value from its
|
|
|
|
// users.
|
|
|
|
//
|
2024-02-16 17:09:58 +02:00
|
|
|
// If name is empty, implementations need to provide a default name.
|
|
|
|
//
|
2024-07-12 20:28:43 +02:00
|
|
|
// The version of the packages using a bridge can be critical information
|
|
|
|
// to include when logging. The bridge should accept this version
|
|
|
|
// information and use the [WithInstrumentationVersion] option to configure
|
|
|
|
// the Logger appropriately.
|
|
|
|
//
|
2024-02-16 17:09:58 +02:00
|
|
|
// Implementations of this method need to be safe for a user to call
|
|
|
|
// concurrently.
|
|
|
|
Logger(name string, options ...LoggerOption) Logger
|
|
|
|
}
|