logger

package
v0.0.0-...-0a73a5e Latest Latest
Warning

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

Go to latest
Published: Jan 3, 2024 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package logger provides support for initializing the log system.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewStdLogger

func NewStdLogger(logger *Logger) *log.Logger

NewStdLogger returns a standard library Logger that wraps the slog Logger.

Types

type Logger

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

Logger represents a logger for logging information.

func New

func New(w io.Writer, serviceName string, traceIDFunc TraceIDFunc) *Logger

New constructs a new log for application use.

func (*Logger) Print

func (log *Logger) Print(ctx context.Context, msg string, args ...any)

Print logs with the given context.

type TraceIDFunc

type TraceIDFunc func(ctx context.Context) string

TraceIDFunc represents a function that can return the trace id from the specified context.

Jump to

Keyboard shortcuts

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