Documentation ¶
Index ¶
Constants ¶
View Source
const ( LogLevelError = "error" LogLevelWarn = "warn" LogLevelInfo = "info" LogLevelDebug = "debug" )
Variables ¶
This section is empty.
Functions ¶
func HTTPLog ¶
func HTTPLog(log Interface, hlp HTTPLogParams, logTitle string)
func WithBaseInfo ¶
Types ¶
type HTTPLogParams ¶
type Interface ¶
type Interface interface { // Debugf uses fmt.Sprintf to construct and log a message at DEBUG level Debug(message string, args ...any) // Errorf uses fmt.Sprintf to construct and log a message at ERROR level Error(message string, args ...any) // Fatalf uses fmt.Sprintf to construct and log a message at FATAL level Fatal(message string, args ...any) // Infof uses fmt.Sprintf to construct and log a message at INFO level Info(message string, args ...any) // Warnf uses fmt.Sprintf to construct and log a message at WARN level Warn(message string, args ...any) // With attributes With(args ...any) }
Interface is a logger that supports log levels, context and structured logging.
type SlogLogger ¶
type SlogLogger struct {
// contains filtered or unexported fields
}
func NewSlogLogger ¶
func NewSlogLogger(level, logDisplayType string, output io.Writer) *SlogLogger
func (*SlogLogger) Debug ¶
func (l *SlogLogger) Debug(msg string, args ...any)
func (*SlogLogger) Error ¶
func (l *SlogLogger) Error(msg string, args ...any)
func (*SlogLogger) Fatal ¶
func (l *SlogLogger) Fatal(msg string, args ...any)
func (*SlogLogger) Info ¶
func (l *SlogLogger) Info(msg string, args ...any)
func (*SlogLogger) Warn ¶
func (l *SlogLogger) Warn(msg string, args ...any)
func (*SlogLogger) With ¶
func (l *SlogLogger) With(args ...any)
Click to show internal directories.
Click to hide internal directories.