logging

package
v0.9.12 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 Close

func Close() error

Close closes the logger and any open file handles

func Debug

func Debug(format string, args ...interface{})

Debug logs a debug message

func Error

func Error(format string, args ...interface{})

Error logs an error message

func Info

func Info(format string, args ...interface{})

Info logs an info message

func Init

func Init(level Level, logFile string, noColor bool) error

Init initializes the global logger with options

func IsDebugEnabled

func IsDebugEnabled() bool

IsDebugEnabled returns true if debug logging is enabled

func SetLevel

func SetLevel(level Level)

SetLevel sets the log level for the default logger

func Warn

func Warn(format string, args ...interface{})

Warn logs a warning message

func WrapError

func WrapError(err error, operation, vdbType, endpoint string) error

WrapError wraps an error with VDB operation context

func WrapErrorWithContext

func WrapErrorWithContext(err error, operation, vdbType, endpoint string, context map[string]interface{}) error

WrapErrorWithContext wraps an error with additional context

Types

type ContextError

type ContextError struct {
	Operation string
	VDBType   string
	Endpoint  string
	Context   map[string]interface{}
	Err       error
}

ContextError creates an error with rich context for debugging

func (*ContextError) Error

func (e *ContextError) Error() string

Error implements the error interface

func (*ContextError) Unwrap

func (e *ContextError) Unwrap() error

Unwrap implements error unwrapping

type Level

type Level int

Level represents logging levels

const (
	LevelDebug Level = iota
	LevelInfo
	LevelWarn
	LevelError
)

func GetLevel

func GetLevel() Level

GetLevel returns the current log level

func ParseLevel

func ParseLevel(level string) (Level, error)

ParseLevel parses a log level string

func (Level) String

func (l Level) String() string

String returns the string representation of the level

type Logger

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

Logger provides structured logging with file output support

Jump to

Keyboard shortcuts

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