logging

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Feb 18, 2026 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Overview

Package logging provides zerolog-based structured logging for OVRSE.

Index

Constants

This section is empty.

Variables

Logger is the global logger instance.

Functions

func Debug

func Debug() *zerolog.Event

Debug logs a debug message. Convenience wrapper.

func Error

func Error() *zerolog.Event

Error logs an error message. Convenience wrapper.

func Info

func Info() *zerolog.Event

Info logs an info message. Convenience wrapper.

func Init

func Init(cfg Config) error

Init initializes the global logger with the given config.

func Initialized

func Initialized() bool

Initialized returns true if the logger has been initialized.

func Warn

func Warn() *zerolog.Event

Warn logs a warning message. Convenience wrapper.

func WithComponent

func WithComponent(component string) zerolog.Logger

WithComponent returns a child logger with component field.

Types

type Config

type Config struct {
	Level    string    // debug, info, warn, error
	Format   string    // text, json
	Output   io.Writer // defaults to os.Stderr
	FilePath string    // optional: also write to file
}

Config holds logger configuration.

func DefaultCLIConfig

func DefaultCLIConfig() Config

DefaultCLIConfig returns default config for CLI mode.

func DefaultMCPConfig

func DefaultMCPConfig() Config

DefaultMCPConfig returns default config for MCP mode. MCP uses stdio for protocol, so logs must go to stderr as JSON.

Jump to

Keyboard shortcuts

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