trace

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2023 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package trace contains tracing utilities such as the logger.

Index

Constants

View Source
const LogPkgKey = "module"

Variables

This section is empty.

Functions

This section is empty.

Types

type HLogger

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

HLogger is the system's default logger.

func (*HLogger) Debug

func (l *HLogger) Debug(mod, msg string, args ...any)

func (*HLogger) Error

func (l *HLogger) Error(mod, msg string, err error, args ...any)

func (*HLogger) Info

func (l *HLogger) Info(mod, msg string, args ...any)

func (*HLogger) Log

func (l *HLogger) Log(level slog.Level, mod string, msg string, args ...any)

func (*HLogger) Warn

func (l *HLogger) Warn(mod, msg string, args ...any)

type Logger

type Logger interface {
	Debug(mod, msg string, args ...any)
	Info(mod, msg string, args ...any)
	Warn(mod, msg string, args ...any)
	Error(mod, msg string, err error, args ...any)
}

func NewLogger

func NewLogger() Logger

NewLogger creates a new standard logger that writes to stdout.

func NewTestLogger

func NewTestLogger(t *testing.T) Logger

type TestLogger

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

TestLogger is a logger that writes to the test's log.

func (*TestLogger) Debug

func (l *TestLogger) Debug(mod, msg string, args ...any)

func (*TestLogger) Error

func (l *TestLogger) Error(mod, msg string, err error, args ...any)

func (*TestLogger) Info

func (l *TestLogger) Info(mod, msg string, args ...any)

func (*TestLogger) Warn

func (l *TestLogger) Warn(mod, msg string, args ...any)

Jump to

Keyboard shortcuts

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