contrib/log/slog
Those integration are enabled by having the
following import in the project’s orchestrion.tool.go file:
import (
_ "github.com/DataDog/orchestrion"
_ "github.com/DataDog/dd-trace-go/contrib/log/slog/v2" // integration
//...
)Package slog provides structured logging, in which log records include a message, a severity level, and various other attributes expressed as key-value pairs.
New
All of
- Import path
log/slog - Function body
- Function declaration
- Function name
New
Introduce new declarations:
//go:linkname __dd_slogtrace_WrapHandler github.com/DataDog/dd-trace-go/contrib/log/slog/v2.WrapHandler
func __dd_slogtrace_WrapHandler(Handler) HandlerRecord link-time dependencies on:
Prepend statements produced by the following template:
{{ .Function.Argument 0 }} = __dd_slogtrace_WrapHandler({{ .Function.Argument 0 }})SetDefault
All of
- Import path
log/slog - Function body
- Function declaration
- Function name
SetDefault
Introduce new declarations:
//go:linkname __dd_slogtrace_IsAlreadyWrapped github.com/DataDog/dd-trace-go/contrib/log/slog/v2.IsAlreadyWrapped
func __dd_slogtrace_IsAlreadyWrapped(Handler) boolRecord link-time dependencies on:
Prepend statements produced by the following template:
if __dd_slogtrace_IsAlreadyWrapped({{ .Function.Argument 0 }}.Handler()) {
defaultLogger.Store({{ .Function.Argument 0 }})
return
}