Documentation ¶
Overview ¶
Package jot provides simple asynchronous logging.
Index ¶
- func Debug(v ...interface{})
- func Debugf(format string, v ...interface{})
- func Error(v ...interface{})
- func Errorf(format string, v ...interface{})
- func Fatal(status int, v ...interface{})
- func FatalIfErr(err error)
- func Fatalf(status int, format string, v ...interface{})
- func Flush()
- func Info(v ...interface{})
- func Infof(format string, v ...interface{})
- func SetMinimumLevel(level Level)
- func SetWriter(w io.Writer)
- func Time(v ...interface{}) logadapter.Timing
- func Timef(format string, v ...interface{}) logadapter.Timing
- func Warn(v ...interface{})
- func Warnf(format string, v ...interface{})
- type Level
- type Logger
- func (lgr *Logger) Debug(v ...interface{})
- func (lgr *Logger) Debugf(format string, v ...interface{})
- func (lgr *Logger) Error(v ...interface{})
- func (lgr *Logger) Errorf(format string, v ...interface{})
- func (lgr *Logger) Fatal(status int, v ...interface{})
- func (lgr *Logger) Fatalf(status int, format string, v ...interface{})
- func (lgr *Logger) Flush()
- func (lgr *Logger) Info(v ...interface{})
- func (lgr *Logger) Infof(format string, v ...interface{})
- func (lgr *Logger) SetMinimumLevel(level Level)
- func (lgr *Logger) SetWriter(w io.Writer)
- func (lgr *Logger) Time(v ...interface{}) logadapter.Timing
- func (lgr *Logger) Timef(format string, v ...interface{}) logadapter.Timing
- func (lgr *Logger) Warn(v ...interface{})
- func (lgr *Logger) Warnf(format string, v ...interface{})
- func (lgr *Logger) Write(data []byte) (int, error)
- type LoggerWriter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Debug ¶
func Debug(v ...interface{})
Debug logs a debugging message. Arguments are handled in the manner of fmt.Print.
func Debugf ¶
func Debugf(format string, v ...interface{})
Debugf logs a debugging message. Arguments are handled in the manner of fmt.Printf.
func Error ¶
func Error(v ...interface{})
Error logs an error message. Arguments are handled in the manner of fmt.Print.
func Errorf ¶
func Errorf(format string, v ...interface{})
Errorf logs an error message. Arguments are handled in the manner of fmt.Printf.
func Fatal ¶
func Fatal(status int, v ...interface{})
Fatal logs a fatal error message. Arguments other than the status are handled in the manner of fmt.Print.
func Fatalf ¶
Fatalf logs a fatal error message. Arguments other than the status are handled in the manner of fmt.Printf.
func Info ¶
func Info(v ...interface{})
Info logs an informational message. Arguments are handled in the manner of fmt.Print.
func Infof ¶
func Infof(format string, v ...interface{})
Infof logs an informational message. Arguments are handled in the manner of fmt.Printf.
func SetMinimumLevel ¶
func SetMinimumLevel(level Level)
SetMinimumLevel sets the minimum log level that will be output. Default is DEBUG.
func SetWriter ¶
SetWriter sets the io.Writer to use when writing log messages. Default is os.Stderr.
func Time ¶
func Time(v ...interface{}) logadapter.Timing
Time starts timing an event and logs an informational message. Arguments are handled in the manner of fmt.Print.
func Timef ¶
func Timef(format string, v ...interface{}) logadapter.Timing
Timef starts timing an event and logs an informational message. Arguments are handled in the manner of fmt.Printf.
Types ¶
type Logger ¶
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.
func (*Logger) Debug ¶
func (lgr *Logger) Debug(v ...interface{})
Debug logs a debug message. Arguments are handled in the manner of fmt.Print.
func (*Logger) Debugf ¶
Debugf logs a debug message. Arguments are handled in the manner of fmt.Printf.
func (*Logger) Error ¶
func (lgr *Logger) Error(v ...interface{})
Error logs an error message. Arguments are handled in the manner of fmt.Print.
func (*Logger) Errorf ¶
Errorf logs an error message. Arguments are handled in the manner of fmt.Printf.
func (*Logger) Fatal ¶
Fatal logs a fatal error message. Arguments other than the status are handled in the manner of fmt.Print.
func (*Logger) Fatalf ¶
Fatalf logs a fatal error message. Arguments other than the status are handled in the manner of fmt.Printf.
func (*Logger) Flush ¶
func (lgr *Logger) Flush()
Flush waits for all current log entries to be written before returning.
func (*Logger) Info ¶
func (lgr *Logger) Info(v ...interface{})
Info logs an informational message. Arguments are handled in the manner of fmt.Print.
func (*Logger) Infof ¶
Infof logs an informational message. Arguments are handled in the manner of fmt.Printf.
func (*Logger) SetMinimumLevel ¶
SetMinimumLevel sets the minimum log level that will be output. Default is DEBUG.
func (*Logger) SetWriter ¶
SetWriter sets the io.Writer to use when writing log messages. Default is os.Stderr.
func (*Logger) Time ¶
func (lgr *Logger) Time(v ...interface{}) logadapter.Timing
Time starts timing an event and logs an informational message. Arguments are handled in the manner of fmt.Print.
func (*Logger) Timef ¶
func (lgr *Logger) Timef(format string, v ...interface{}) logadapter.Timing
Timef starts timing an event and logs an informational message. Arguments are handled in the manner of fmt.Printf.
func (*Logger) Warn ¶
func (lgr *Logger) Warn(v ...interface{})
Warn logs a warning message. Arguments are handled in the manner of fmt.Print.
type LoggerWriter ¶
type LoggerWriter struct {
Filter func(v ...interface{})
}
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)