Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document Logger name and version recommendations #5613

Merged
merged 3 commits into from
Jul 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions log/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,19 @@ type LoggerProvider interface {

// Logger returns a new [Logger] with the provided name and configuration.
//
// 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.
//
// If name is empty, implementations need to provide a default name.
//
// 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.
//
// Implementations of this method need to be safe for a user to call
// concurrently.
Logger(name string, options ...LoggerOption) Logger
Expand Down