Documentation ¶
Index ¶
- func Context(ctx context.Context, logger logrus.FieldLogger) context.Context
- func FromContext(ctx context.Context) logrus.FieldLogger
- func LogWriter(log func(...interface{})) io.Writer
- func New(out io.Writer, format, level string) *logrus.Logger
- func SetFormat(format string)
- func SetLevel(level string)
- func TestLogger(c interface{ ... }) *logrus.Logger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Context ¶
Context returns a new child context such that FromContext(child) returns the given logger.
func FromContext ¶
func FromContext(ctx context.Context) logrus.FieldLogger
FromContext returns the logger suitable for the given context -- the one attached by contextWithLogger() if applicable, otherwise the top-level logger with no fields/values.
func LogWriter ¶
LogWriter returns an io.Writer that writes to the given log func, which is typically (*check.C).Log().
func New ¶
New returns a new logger with the indicated format and level.
func SetFormat ¶
func SetFormat(format string)
SetFormat sets the current logging format to "json" or "text".
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.