Documentation
¶
Overview ¶
Package bridge routes all logs from log, log/slog, github.com/gemalto/flume, and github.com/ThalesGroup/flume/v2 to a single logging backend: either github.com/gemalto/flume or github.com/ThalesGroup/flume/v2.
This is useful for code bases which use a mix of logging packages, or are in the process of transitions from flume to flume/v2.
Call either ToV1() or ToV2() early in your programs main function.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ToV1 ¶
func ToV1() error
ToV1 routes all logging to github.com/gemalto/flume, e.g.:
import (
flumev1 "github.com/gemalto/flume"
flumev2 "github.com/ThalesGroup/flume/v2"
"github.com/gemalto/flume/bridge"
)
func main() {
flumev1.ConfigFromEnv()
bridge.ToV1()
v1Log := flumev1.New("main")
v2Log := flumev2.New("main")
// both these call will ultimately be handled, formatted,
// and output by flumev1/zap
v1Log.Info("hi")
v2Log.InfoContext("hi")
}
func ToV2 ¶
func ToV2() error
ToV2 routes all logging to github.com/gemalto/flume, e.g.:
import (
flumev1 "github.com/gemalto/flume"
flumev2 "github.com/ThalesGroup/flume/v2"
"github.com/gemalto/flume/bridge"
)
func main() {
flumev2.ConfigFromEnv()
bridge.ToV2()
v1Log := flumev1.New("main")
v2Log := flumev2.New("main")
// both these call will ultimately be handled, formatted,
// and output by flumev2/slog
v1Log.Info("hi")
v2Log.InfoContext("hi")
}
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.