pachyderm: github.com/pachyderm/pachyderm/src/server/pkg/log Index | Files

package log

import "github.com/pachyderm/pachyderm/src/server/pkg/log"

Index

Package Files

log.go

func Pretty Uses

func Pretty(entry *logrus.Entry) ([]byte, error)

Pretty formats a logrus entry like so: “` 2019-02-11T16:02:02Z INFO pfs.API.InspectRepo {"request":{"repo":{"name":"images"}}} [] “`

type FormatterFunc Uses

type FormatterFunc func(entry *logrus.Entry) ([]byte, error)

FormatterFunc is a type alias for a function that satisfies logrus' `Formatter` interface

func (FormatterFunc) Format Uses

func (f FormatterFunc) Format(entry *logrus.Entry) ([]byte, error)

Format proxies the closure in order to satisfy `logrus.Formatter`'s interface.

type GRPCLogWriter Uses

type GRPCLogWriter struct {
    // contains filtered or unexported fields
}

GRPCLogWriter proxies gRPC and etcd-produced log messages to a logrus logger. Because it implements `io.Writer`, it could be used anywhere where `io.Writer`s are used, but it has some logic specifically designed to handle gRPC-formatted logs.

func NewGRPCLogWriter Uses

func NewGRPCLogWriter(logger *logrus.Logger, source string) *GRPCLogWriter

NewGRPCLogWriter creates a new GRPC log writer. `logger` specifies the underlying logger, and `source` specifies where these logs are coming from; it is added as a entry field for all log messages.

func (*GRPCLogWriter) Write Uses

func (l *GRPCLogWriter) Write(p []byte) (int, error)

Write allows `GRPCInfoWriter` to implement the `io.Writer` interface. This will take gRPC logs, which look something like this: “` INFO: 2019/02/18 12:21:54 ClientConn switching balancer to "pick_first" “` strip out redundant content, and print the message at the appropriate log level in logrus. Any parse errors of the log message will be reported in logrus as well.

type Logger Uses

type Logger interface {
    Log(request interface{}, response interface{}, err error, duration time.Duration)
    LogAtLevelFromDepth(request interface{}, response interface{}, err error, duration time.Duration, level logrus.Level, depth int)
}

Logger is a helper for emitting our grpc API logs

func NewLocalLogger Uses

func NewLocalLogger(service string) Logger

NewLocalLogger creates a new logger for local testing (which does not report prometheus metrics)

func NewLogger Uses

func NewLogger(service string) Logger

NewLogger creates a new logger

Package log imports 9 packages (graph) and is imported by 15 packages. Updated 2019-08-25. Refresh now. Tools for package owners.