Documentation
¶
Overview ¶
Deprecated: Package gokit provides BaseLogger implementation for go-kit/log. The go-kit/log library is in maintenance mode and no longer actively developed. Use the slog backend (loggers/slog) instead, which is the default and recommended backend.
Example ¶
This example shows how to use the gokit backend.
Deprecated: Use the slog backend instead (loggers/slog). The go-kit/log library is in maintenance mode and no longer actively developed.
package main
import (
"context"
"github.com/go-coldbrew/log"
"github.com/go-coldbrew/log/loggers"
"github.com/go-coldbrew/log/loggers/gokit"
)
func main() {
logger := gokit.NewLogger(
loggers.WithJSONLogs(true),
loggers.WithCallerInfo(true),
)
log.SetLogger(log.NewLogger(logger))
ctx := context.Background()
log.Info(ctx, "msg", "request handled", "method", "GET", "path", "/api/v1")
}
Output:
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.