Documentation ¶
Index ¶
- func FmtBytes(n int64) string
- type Logger
- func (l *Logger) Check(v bool, msg ...interface{})
- func (l *Logger) CheckError(err error, msg ...interface{})
- func (l *Logger) Debug(f string, args ...interface{})
- func (l *Logger) Error(f string, args ...interface{})
- func (l *Logger) Fatal(f string, args ...interface{})
- func (l *Logger) Print(f string, args ...interface{})
- func (l *Logger) Verbose(f string, args ...interface{})
- func (l *Logger) Warning(f string, args ...interface{})
- type ReportingReader
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Logger ¶
type Logger struct { NErrors int // contains filtered or unexported fields }
Logger provides a simple logging system with a few different log levels; debugging and verbose output may both be suppressed independently.
func (*Logger) Check ¶
Checks the provided condition and prints a fatal error if it's false. The error message includes the source file and line number where the check failed. An optional message specified with printf-style formatting may be provided to print with the error message.
func (*Logger) CheckError ¶
Similar to Check, CheckError prints a fatal error if the given error is non-nil. It also takes an optional format string.
type ReportingReader ¶
Small wrapper around io.Reader that implements io.ReadCloser. Periodically logs how many bytes have been read and the rate of processing them in bytes / second.
func (*ReportingReader) Close ¶
func (r *ReportingReader) Close() error