logging

package
v0.2.0-rc8 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2026 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package logging provider logging facilities.

Index

Constants

This section is empty.

Variables

AllModules lists all available modules for logging.

View Source
var PerfLogger *log.Logger = NopLogger()

PerfLogger is a nil logger than can be set to a real one to log timing information from multiple places.

Functions

func Init

func Init(output io.Writer, enabledModules []Module)

Init initializes the logging registry with the given output and enabled modules. This should be called once at startup before any components are created.

func LoggerFor

func LoggerFor(module Module) *log.Logger

LoggerFor returns a logger for the specified module. If the module is enabled, it returns a real logger; otherwise, it returns a NopLogger.

func NewLogger

func NewLogger(w io.Writer) *log.Logger

func NopLogger

func NopLogger() *log.Logger

func ParseExecLogPath

func ParseExecLogPath(method string, rawPath string) (string, error)

func ParseRawPath

func ParseRawPath(name string, rawPath string) (string, error)

func ValidateExecLogPath

func ValidateExecLogPath(rawPath string) error

Types

type FileLogger

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

FileLogger wraps a file-based logger.

func NewFileLogger

func NewFileLogger(rawPath string) (*FileLogger, error)

NewFileLogger creates a new file-based logger.

func (*FileLogger) Close

func (fl *FileLogger) Close() error

Close closes the log file.

func (*FileLogger) Logger

func (fl *FileLogger) Logger() *log.Logger

Logger returns the underlying logger.

func (*FileLogger) Writer

func (fl *FileLogger) Writer() io.Writer

Writer returns the underlying io.Writer for the file logger.

type InvalidModuleError

type InvalidModuleError struct {
	Module       string
	ValidModules []string
}

InvalidModuleError is returned when an invalid module name is specified.

func (*InvalidModuleError) Error

func (e *InvalidModuleError) Error() string

type Module

type Module string

Module represents a loggable component in the system.

const (
	ModuleLangServer Module = "langserver"
	ModuleHandlers   Module = "handlers"
	ModuleEventBus   Module = "eventbus"
	ModuleModules    Module = "modules"
	ModuleCRDs       Module = "crds"
	ModuleFilesystem Module = "filesystem"
	ModuleDocStore   Module = "docstore"
	ModulePerf       Module = "perf"
)

func ParseModules

func ParseModules(input string) ([]Module, error)

ParseModules parses a comma-separated list of module names. The special value "all" enables all modules.

Jump to

Keyboard shortcuts

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