log

package
v0.0.0-...-e0d78a2 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2024 License: BSD-3-Clause, CC-BY-4.0 Imports: 6 Imported by: 0

Documentation

Overview

Package log implements event handlers for logging.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debugf

func Debugf(ctx context.Context, format string, args ...interface{})

func Errorf

func Errorf(ctx context.Context, format string, args ...interface{})

func FromContext

func FromContext(ctx context.Context) *slog.Logger

func Infof

func Infof(ctx context.Context, format string, args ...interface{})

func NewContext

func NewContext(ctx context.Context, l *slog.Logger) context.Context

func NewGoogleCloudHandler

func NewGoogleCloudHandler(level slog.Leveler) slog.Handler

NewGoogleCloudHandler returns a Handler that outputs JSON for the Google Cloud logging service. See https://cloud.google.com/logging/docs/agent/logging/configuration#special-fields for treatment of special fields.

func Warningf

func Warningf(ctx context.Context, format string, args ...interface{})

Types

type Attrs

type Attrs []slog.Attr

func With

func With(args ...any) Attrs

func (Attrs) Debugf

func (as Attrs) Debugf(ctx context.Context, format string, args ...interface{})

func (Attrs) Errorf

func (as Attrs) Errorf(ctx context.Context, format string, args ...interface{})

func (Attrs) Infof

func (as Attrs) Infof(ctx context.Context, format string, args ...interface{})

func (Attrs) Warningf

func (as Attrs) Warningf(ctx context.Context, format string, args ...interface{})

Jump to

Keyboard shortcuts

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