logging

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2026 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Logger

type Logger struct {
	*slog.Logger
	// contains filtered or unexported fields
}

Logger wraps slog.Logger with cleanup capability and dynamic handlers

func Must

func Must(opts ...Option) *Logger

Must wraps NewWithOptions and panics on error

func New

func New(opts ...Option) (*Logger, error)

New creates a logger with options (for upterm client)

func (*Logger) Close

func (l *Logger) Close() error

Close cleans up resources

func (*Logger) With

func (l *Logger) With(args ...any) *Logger

With returns a new logger with additional attributes

func (*Logger) WithGroup

func (l *Logger) WithGroup(name string) *Logger

WithGroup returns a new logger with a group

type Option

type Option func(*config) error

Option configures a logger

func Console

func Console() Option

Console logs to stderr

func Debug

func Debug() Option

Debug sets debug level

func File

func File(path string) Option

File logs to a file (path is required)

func Level

func Level(level slog.Level) Option

Level sets the log level

func Sentry

func Sentry(dsn string) Option

Sentry enables Sentry error reporting

Jump to

Keyboard shortcuts

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