logging

package
v0.1.18 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ContextWithLogger

func ContextWithLogger(ctx context.Context, logger *zap.Logger) context.Context

ContextWithLogger returns a new context with the given logger.

func EnsureLogFile

func EnsureLogFile(logPath string) error

EnsureLogFile ensures the log file and its directory exist.

func LoggerFromContext

func LoggerFromContext(ctx context.Context) (*zap.Logger, bool)

LoggerFromContext retrieves the logger from the given context, or returns false if not found.

func NewLogger

func NewLogger(levelStr, logPath string) (*zap.Logger, error)

NewLogger creates a new zap.Logger instance with file output. It returns a *zap.Logger, which is now the standard logger type across the app.

func NewLoggerWithStderr

func NewLoggerWithStderr(levelStr, logPath string, includeStderr bool) (*zap.Logger, error)

NewLoggerWithStderr creates a new zap.Logger instance with optional stderr output. When includeStderr is false, logs only go to file (useful for MCP mode over stdio).

Types

This section is empty.

Jump to

Keyboard shortcuts

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