logging

package
v0.2.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Debug

func Debug(op, msg string)

func DebugEnabled

func DebugEnabled() bool

func DebugTimer

func DebugTimer(op, startMsg string) func(doneMsg string)

func Error

func Error(op, msg string)

func Info

func Info(op, msg string)

func LogPath

func LogPath() string

Types

type Level

type Level string
const (
	LevelDebug Level = "DEBUG"
	LevelInfo  Level = "INFO"
	LevelError Level = "ERROR"
)

type Logger

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

func Default

func Default() *Logger

func New

func New(projectRoot string, opts Options) (*Logger, error)

func (*Logger) Close

func (l *Logger) Close() error

func (*Logger) Debug

func (l *Logger) Debug(op, msg string)

func (*Logger) DebugEnabled

func (l *Logger) DebugEnabled() bool

func (*Logger) DebugTimer

func (l *Logger) DebugTimer(op, startMsg string) func(doneMsg string)

DebugTimer logs a DEBUG start message and returns a closure that logs a DEBUG done message with duration. When DEBUG is disabled, it returns a no-op closure and does not call time.Now().

func (*Logger) Error

func (l *Logger) Error(op, msg string)

func (*Logger) Info

func (l *Logger) Info(op, msg string)

func (*Logger) Path

func (l *Logger) Path() string

type Options

type Options struct {
	// DebugEnabled controls whether DEBUG logs are written.
	// When using Default(), this is derived from SUBTASK_DEBUG once at init.
	DebugEnabled bool

	// MaxBytes controls log rotation. If zero, a default is used.
	MaxBytes int64

	Now func() time.Time
}

Jump to

Keyboard shortcuts

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