package bklog

import "github.com/moby/buildkit/util/bklog"

Index

Variables

var (
	G = GetLogger
	L = logrus.NewEntry(logrus.StandardLogger())
)

Functions

func EnableLogWithTraceID

func EnableLogWithTraceID(b bool)

func GetLogger

func GetLogger(ctx context.Context) (l *logrus.Entry)

GetLogger retrieves the current logger from the context. If no logger is available, the default logger is returned.

func WithLogger

func WithLogger(ctx context.Context, logger *logrus.Entry) context.Context

WithLogger returns a new context with the provided logger. Use in combination with logger.WithField(s) for great effect.

Types

type LazyStackTrace

type LazyStackTrace struct{}

LazyStackTrace lets you include a stack trace as a field's value in a log but only call it when the log level is actually enabled.

func (LazyStackTrace) MarshalText

func (LazyStackTrace) MarshalText() ([]byte, error)

func (LazyStackTrace) String

func (LazyStackTrace) String() string

Source Files

log.go

Version
v0.12.0-rc1
Published
Jun 30, 2023
Platform
js/wasm
Imports
5 packages
Last checked
6 minutes ago

Tools for package owners.