Documentation ¶
Index ¶
- func SanitizeLogFile(filePath string, output io.Writer) error
- type DefaultLogger
- func (l *DefaultLogger) Debug() *zerolog.Event
- func (l *DefaultLogger) Err(err error) *zerolog.Event
- func (l *DefaultLogger) Error() *zerolog.Event
- func (l *DefaultLogger) Fatal() *zerolog.Event
- func (l *DefaultLogger) Info() *zerolog.Event
- func (l *DefaultLogger) Log() *zerolog.Event
- func (l *DefaultLogger) Print(v ...interface{})
- func (l *DefaultLogger) Printf(format string, v ...interface{})
- func (l *DefaultLogger) RegisterSSEWriter(sse *sse.Server)
- func (l *DefaultLogger) SetLogLevel(level string)
- func (l *DefaultLogger) Trace() *zerolog.Event
- func (l *DefaultLogger) Warn() *zerolog.Event
- func (l *DefaultLogger) With() zerolog.Context
- type Formatter
- type LogMessage
- type Logger
- type SSEWriter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type DefaultLogger ¶
type DefaultLogger struct {
// contains filtered or unexported fields
}
DefaultLogger default logging controller
func (*DefaultLogger) Debug ¶
func (l *DefaultLogger) Debug() *zerolog.Event
Debug log something at debug level.
func (*DefaultLogger) Err ¶
func (l *DefaultLogger) Err(err error) *zerolog.Event
Err log something at Err level
func (*DefaultLogger) Error ¶
func (l *DefaultLogger) Error() *zerolog.Event
Error log something at Error level
func (*DefaultLogger) Fatal ¶
func (l *DefaultLogger) Fatal() *zerolog.Event
Fatal log something at fatal level. This will panic!
func (*DefaultLogger) Info ¶
func (l *DefaultLogger) Info() *zerolog.Event
Info log something at fatal level.
func (*DefaultLogger) Log ¶
func (l *DefaultLogger) Log() *zerolog.Event
Log log something at fatal level.
func (*DefaultLogger) Print ¶ added in v1.40.0
func (l *DefaultLogger) Print(v ...interface{})
Print sends a log event using debug level and no extra field. Arguments are handled in the manner of fmt.Print.
func (*DefaultLogger) Printf ¶ added in v1.40.0
func (l *DefaultLogger) Printf(format string, v ...interface{})
Printf sends a log event using debug level and no extra field. Arguments are handled in the manner of fmt.Printf.
func (*DefaultLogger) RegisterSSEWriter ¶ added in v1.29.0
func (l *DefaultLogger) RegisterSSEWriter(sse *sse.Server)
func (*DefaultLogger) SetLogLevel ¶
func (l *DefaultLogger) SetLogLevel(level string)
func (*DefaultLogger) Trace ¶
func (l *DefaultLogger) Trace() *zerolog.Event
Trace log something at fatal level. This will panic!
func (*DefaultLogger) Warn ¶
func (l *DefaultLogger) Warn() *zerolog.Event
Warn log something at warning level.
type Formatter ¶ added in v1.29.0
type Formatter func(interface{}) string
Formatter transforms the input into a formatted string.
type LogMessage ¶
type LogMessage struct { Time string `json:"time"` Level string `json:"level"` Message string `json:"message"` }
func (LogMessage) Bytes ¶ added in v1.29.0
func (m LogMessage) Bytes() ([]byte, error)
type Logger ¶
type Logger interface { Log() *zerolog.Event Fatal() *zerolog.Event Err(err error) *zerolog.Event Error() *zerolog.Event Warn() *zerolog.Event Info() *zerolog.Event Trace() *zerolog.Event Debug() *zerolog.Event With() zerolog.Context RegisterSSEWriter(sse *sse.Server) SetLogLevel(level string) Printf(format string, v ...interface{}) Print(v ...interface{}) }
Logger interface