Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConsoleLogger ¶
type ConsoleLogger struct {
// contains filtered or unexported fields
}
ConsoleLogger writes log entries to os.Stdout with level filtering.
func NewConsoleLogger ¶
func NewConsoleLogger(level LogLevel) *ConsoleLogger
NewConsoleLogger creates a ConsoleLogger that only emits messages at or above the given level. Output goes to os.Stdout.
func (*ConsoleLogger) Debug ¶
func (c *ConsoleLogger) Debug(msg string, args ...any)
func (*ConsoleLogger) Error ¶
func (c *ConsoleLogger) Error(msg string, args ...any)
func (*ConsoleLogger) Info ¶
func (c *ConsoleLogger) Info(msg string, args ...any)
func (*ConsoleLogger) Warn ¶
func (c *ConsoleLogger) Warn(msg string, args ...any)
type FileLogger ¶
type FileLogger struct {
// contains filtered or unexported fields
}
FileLogger writes log entries to a file with level filtering.
func NewFileLogger ¶
func NewFileLogger(path string, level LogLevel) (*FileLogger, error)
NewFileLogger creates a FileLogger that appends to the file at path. Only messages at or above the given level are written.
func (*FileLogger) Close ¶
func (fl *FileLogger) Close() error
Close closes the underlying file. It is a no-op if the FileLogger was created with a plain io.Writer (testing path).
func (*FileLogger) Debug ¶
func (fl *FileLogger) Debug(msg string, args ...any)
func (*FileLogger) Error ¶
func (fl *FileLogger) Error(msg string, args ...any)
func (*FileLogger) Info ¶
func (fl *FileLogger) Info(msg string, args ...any)
func (*FileLogger) Warn ¶
func (fl *FileLogger) Warn(msg string, args ...any)
type LogLevel ¶
type LogLevel int
LogLevel represents the severity of a log message.
func ParseLevel ¶
ParseLevel converts a string to a LogLevel. It is case-insensitive. Unrecognised strings default to LevelInfo.
type Logger ¶
type Logger interface {
Debug(msg string, args ...any)
Info(msg string, args ...any)
Warn(msg string, args ...any)
Error(msg string, args ...any)
}
Logger defines the logging interface used throughout go-migration.