jsonlog

package
v0.0.0-...-a693937 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2025 License: MIT Imports: 5 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

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

func New

func New(out io.Writer, minLevel slog.Level) *Logger

New creates a new logger instance with JSON output and a minimum logging level.

func (*Logger) PrintDebug

func (l *Logger) PrintDebug(ctx context.Context, message string, properties map[string]string)

PrintDebug logs a debug-level message with additional properties.

func (*Logger) PrintError

func (l *Logger) PrintError(ctx context.Context, err error, properties map[string]string)

PrintError logs an error message with additional properties.

func (*Logger) PrintFatal

func (l *Logger) PrintFatal(ctx context.Context, err error, properties map[string]string)

PrintFatal logs a fatal error message, adds a trace, and exits the application.

func (*Logger) PrintInfo

func (l *Logger) PrintInfo(ctx context.Context, message string, properties map[string]string)

PrintInfo logs an informational message with additional properties.

Jump to

Keyboard shortcuts

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