Documentation ¶
Overview ¶
Package jot provides simple asynchronous logging.
Index ¶
- func Debug(v ...any)deprecated
- func Debugf(format string, v ...any)deprecated
- func Error(v ...any)deprecated
- func Errorf(format string, v ...any)deprecated
- func Fatal(status int, v ...any)deprecated
- func FatalIfErr(err error)deprecated
- func Fatalf(status int, format string, v ...any)deprecated
- func Flush()deprecated
- func Info(v ...any)deprecated
- func Infof(format string, v ...any)deprecated
- func SetMinimumLevel(level Level)deprecated
- func SetWriter(w io.Writer)deprecated
- func Time(v ...any) logadapter.Timingdeprecated
- func Timef(format string, v ...any) logadapter.Timingdeprecated
- func Warn(v ...any)deprecated
- func Warnf(format string, v ...any)deprecated
- type Leveldeprecated
- type Loggerdeprecated
- func (lgr *Logger) Debug(v ...any)deprecated
- func (lgr *Logger) Debugf(format string, v ...any)deprecated
- func (lgr *Logger) Error(v ...any)deprecated
- func (lgr *Logger) Errorf(format string, v ...any)deprecated
- func (lgr *Logger) Fatal(status int, v ...any)deprecated
- func (lgr *Logger) Fatalf(status int, format string, v ...any)deprecated
- func (lgr *Logger) Flush()deprecated
- func (lgr *Logger) Info(v ...any)deprecated
- func (lgr *Logger) Infof(format string, v ...any)deprecated
- func (lgr *Logger) SetMinimumLevel(level Level)deprecated
- func (lgr *Logger) SetWriter(w io.Writer)deprecated
- func (lgr *Logger) Time(v ...any) logadapter.Timingdeprecated
- func (lgr *Logger) Timef(format string, v ...any) logadapter.Timingdeprecated
- func (lgr *Logger) Warn(v ...any)deprecated
- func (lgr *Logger) Warnf(format string, v ...any)deprecated
- func (lgr *Logger) Write(data []byte) (int, error)deprecated
- type LoggerWriterdeprecated
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FatalIfErr
deprecated
func FatalIfErr(err error)
FatalIfErr calls 'Fatal(1, err)' if 'err' is not nil.
Deprecated: Use slog instead. August 28, 2023
func Flush
deprecated
func Flush()
Flush waits for all current log entries to be written before returning.
Deprecated: Use slog instead. August 28, 2023
func SetMinimumLevel
deprecated
func SetMinimumLevel(level Level)
SetMinimumLevel sets the minimum log level that will be output. Default is DEBUG.
Deprecated: Use slog instead. August 28, 2023
func Time
deprecated
func Time(v ...any) logadapter.Timing
Time starts timing an event and logs an informational message. Arguments are handled in the manner of fmt.Print.
Deprecated: Use slog instead. August 28, 2023
func Timef
deprecated
func Timef(format string, v ...any) logadapter.Timing
Timef starts timing an event and logs an informational message. Arguments are handled in the manner of fmt.Printf.
Deprecated: Use slog instead. August 28, 2023
Types ¶
type Logger
deprecated
type Logger struct{}
Logger wraps the various jot function calls into a struct that can be passed around, typically for the sake of satisfying one or more logging interfaces.
Deprecated: Use slog instead. August 28, 2023
func (*Logger) SetMinimumLevel
deprecated
func (*Logger) Time
deprecated
func (lgr *Logger) Time(v ...any) logadapter.Timing
Time starts timing an event and logs an informational message. Arguments are handled in the manner of fmt.Print.
Deprecated: Use slog instead. August 28, 2023
type LoggerWriter
deprecated
type LoggerWriter struct {
Filter func(v ...any)
}
LoggerWriter provides a bridge between the standard log.Logger and the jot package. You can use it like this:
log.New(&jot.LoggerWriter{}, "", 0)
This will send all output for this logger to the jot.Error() call.
You can also set the Filter function to direct the output to a particular jot logging method:
log.New(&jot.LoggerWriter{Filter: jot.Info}), "", 0)
Deprecated: Use slog instead. August 28, 2023
func (*LoggerWriter) Write
deprecated
func (w *LoggerWriter) Write(p []byte) (n int, err error)
Write implements the io.Writer interface required by log.Logger.
Deprecated: Use slog instead. August 28, 2023