Documentation ¶
Overview ¶
Package log provides structures for logging.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ConsoleLogger ¶
ConsoleLogger implements Logger interface. It represents logger that outputs to os.Stdout and os.Stderr.
func NewConsoleLogger ¶
func NewConsoleLogger() *ConsoleLogger
NewConsoleLogger creates *log.Logger and embeds it into ConsoleLogger. It returns pointer to a ConsoleLogger instance.
func (*ConsoleLogger) Debug ¶
func (logger *ConsoleLogger) Debug(format string, v ...any)
Debug outputs variables in specified format with DEBUG prefix.
func (*ConsoleLogger) Error ¶
func (logger *ConsoleLogger) Error(format string, v ...any)
Error outputs variables in specified format with ERROR prefix.
func (*ConsoleLogger) Fatal ¶
func (logger *ConsoleLogger) Fatal(format string, v ...any)
Fatal outputs variables in specified format with FATAL prefix. It also calls os.Exit(1).
func (*ConsoleLogger) Info ¶
func (logger *ConsoleLogger) Info(format string, v ...any)
Info outputs variables in specified format with INFO prefix.
type Logger ¶
type Logger interface { // Debug outputs variables in specified format with DEBUG prefix. Debug(format string, v ...any) // Info outputs variables in specified format with INFO prefix. Info(format string, v ...any) // Error outputs variables in specified format with ERROR prefix. Error(format string, v ...any) // Fatal outputs variables in specified format with FATAL prefix. // It also calls os.Exit(1). Fatal(format string, v ...any) }
Logger is interface implemented by types that can log at various levels.
Click to show internal directories.
Click to hide internal directories.