Documentation ¶
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FieldLogger ¶
type FieldLogger interface { logrus.FieldLogger GetLevel() logrus.Level }
FieldLogger interface combines logrus.FieldLogger with GetLevel method useful to represent a wrapper around *logrus.Logger.
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger provides the kgo.Logger interface for usage in kgo.WithLogger when initializing a client.
func New ¶
New returns a new Logger using a *logrus.Logger instance.
Example ¶
package main import ( "github.com/sirupsen/logrus" "github.com/twmb/franz-go/pkg/kgo" "github.com/twmb/franz-go/plugin/klogrus" ) func main() { l := klogrus.New(logrus.New()) l.Log(kgo.LogLevelInfo, "test message", "test-key", "test-val") }
Output:
func NewFieldLogger ¶
func NewFieldLogger(fl FieldLogger) *Logger
NewFieldLogger returns a new Logger using a FieldLogger interface. it is isofunctional with New constructor, except it can accept either *logrus.Logger or a possible wrapper that implements logrus.FieldLogger and includes GetLevel method.
Click to show internal directories.
Click to hide internal directories.