| 1 |
// Copyright The OpenTelemetry Authors |
| 2 |
// SPDX-License-Identifier: Apache-2.0 |
| 3 |
|
| 4 |
package log // import "go.opentelemetry.io/otel/log" |
| 5 |
|
| 6 |
import "go.opentelemetry.io/otel/log/embedded" |
| 7 |
|
| 8 |
// LoggerProvider provides access to [Logger]. |
| 9 |
// |
| 10 |
// Warning: Methods may be added to this interface in minor releases. See |
| 11 |
// package documentation on API implementation for information on how to set |
| 12 |
// default behavior for unimplemented methods. |
| 13 |
type LoggerProvider interface { |
| 14 |
// Users of the interface can ignore this. This embedded type is only used |
| 15 |
// by implementations of this interface. See the "API Implementations" |
| 16 |
// section of the package documentation for more information. |
| 17 |
embedded.LoggerProvider |
| 18 |
|
| 19 |
// Logger returns a new [Logger] with the provided name and configuration. |
| 20 |
// |
| 21 |
// The name needs to uniquely identify the source of logged code. It is |
| 22 |
// recommended that name is the Go package name of the library using a log |
| 23 |
// bridge (note: this is not the name of the bridge package). Most |
| 24 |
// commonly, this means a bridge will need to accept this value from its |
| 25 |
// users. |
| 26 |
// |
| 27 |
// If name is empty, implementations need to provide a default name. |
| 28 |
// |
| 29 |
// The version of the packages using a bridge can be critical information |
| 30 |
// to include when logging. The bridge should accept this version |
| 31 |
// information and use the [WithInstrumentationVersion] option to configure |
| 32 |
// the Logger appropriately. |
| 33 |
// |
| 34 |
// Implementations of this method need to be safe for a user to call |
| 35 |
// concurrently. |
| 36 |
Logger(name string, options ...LoggerOption) Logger |
| 37 |
} |