Documentation
¶
Index ¶
- func Close() error
- func Debug(format string, args ...interface{})
- func Error(format string, args ...interface{})
- func Info(format string, args ...interface{})
- func Init(level Level, logFile string, noColor bool) error
- func InitWithFormat(level Level, format Format, logFile string, noColor bool) error
- func IsDebugEnabled() bool
- func SetLevel(level Level)
- func Warn(format string, args ...interface{})
- func WrapError(err error, operation, vdbType, endpoint string) error
- func WrapErrorWithContext(err error, operation, vdbType, endpoint string, context map[string]interface{}) error
- type ContextError
- type Format
- type Level
- type Logger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func InitWithFormat ¶ added in v0.9.15
InitWithFormat initializes the global logger with format option
func IsDebugEnabled ¶
func IsDebugEnabled() bool
IsDebugEnabled returns true if debug logging is enabled
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 Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger provides structured logging with file output support
func WithCollection ¶ added in v0.9.15
WithCollection creates a logger with collection context
func WithDocument ¶ added in v0.9.15
WithDocument creates a logger with document context
func WithFields ¶ added in v0.9.15
WithFields creates a logger with structured fields
func (*Logger) Debug ¶ added in v0.9.15
DebugWithFields logs a debug message with this logger's fields
func (*Logger) Error ¶ added in v0.9.15
ErrorWithFields logs an error message with this logger's fields
Click to show internal directories.
Click to hide internal directories.