logfc

package
v2.0.0-beta.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 20, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AtLevel

func AtLevel(ctx context.Context, level logf.Level, fn func(logf.LogFunc))

AtLevel calls the given fn if logging at the specified level is enabled.

func Debug

func Debug(ctx context.Context, text string, fs ...logf.Field)

Debug logs a debug message using the logger from ctx.

func Error

func Error(ctx context.Context, text string, fs ...logf.Field)

Error logs an error message using the logger from ctx.

func Get

func Get(ctx context.Context) *logf.Logger

Get returns the logf.Logger associated with ctx. Returns DisabledLogger() if no logger is associated.

func Info

func Info(ctx context.Context, text string, fs ...logf.Field)

Info logs an info message using the logger from ctx.

func New

func New(parent context.Context, logger *logf.Logger) context.Context

New returns a new context.Context with the given logger associated with it.

func Warn

func Warn(ctx context.Context, text string, fs ...logf.Field)

Warn logs a warning message using the logger from ctx.

func With

func With(ctx context.Context, fields ...logf.Field) context.Context

With returns a new context with the logger derived from ctx with the given additional fields.

func WithCaller

func WithCaller(ctx context.Context) context.Context

WithCaller returns a new context with the logger derived from ctx with caller reporting enabled.

func WithCallerSkip

func WithCallerSkip(ctx context.Context, n int) context.Context

WithCallerSkip returns a new context with the logger derived from ctx with increased number of skipped caller frames.

func WithGroup

func WithGroup(ctx context.Context, name string) context.Context

WithGroup returns a new context with the logger derived from ctx that nests all subsequent fields under the given group name.

func WithName

func WithName(ctx context.Context, name string) context.Context

WithName returns a new context with the logger derived from ctx with the given name appended.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL