log

package
v2.2.1 Latest Latest
Warning

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

Go to latest
Published: Jun 27, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewFoundationLogger added in v2.2.0

func NewFoundationLogger() flogger.Logger

NewFoundationLogger returns the underlying go-foundation structured logger, useful for advanced use cases like adding sinks or structured fields.

Example:

fl := log.NewFoundationLogger()
fl.Info("structured message", logger.Field{Key: "user", Value: "alice"})

Types

type LogLevel

type LogLevel int

LogLevel represents the severity of a log message.

const (
	LogLevelInfo LogLevel = iota
	LogLevelSuccess
	LogLevelWarning
	LogLevelError
)

type Logger

type Logger interface {
	Info(format string, a ...any)
	Success(format string, a ...any)
	Warning(format string, a ...any)
	Error(format string, a ...any)
}

Logger defines the interface for logging messages with different severity levels.

func New

func New() Logger

New creates a new instance of the Logger, backed by go-foundation's structured logger.

Example:

logger := log.New()
logger.Info("Starting application...")

Jump to

Keyboard shortcuts

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