Documentation
¶
Index ¶
- type BuilderLogger
- type Log
- type Logger
- type NullLogger
- func (nl *NullLogger) Fatal(v ...interface{})
- func (nl *NullLogger) Fatalf(format string, v ...interface{})
- func (nl *NullLogger) Fatalln(v ...interface{})
- func (nl *NullLogger) Panicf(format string, v ...interface{})
- func (nl *NullLogger) Panicln(v ...interface{})
- func (nl *NullLogger) Print(v ...interface{})
- func (nl *NullLogger) Printf(format string, v ...interface{})
- func (nl *NullLogger) Println(v ...interface{})
- func (nl *NullLogger) Write(p []byte) (int, error)
- type OutWriter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BuilderLogger ¶
BuilderLogger is the implementation of the Log interface for this project.
func Initialize ¶
func Initialize(quiet bool) *BuilderLogger
Initialize returns a BuilderLogger that either contains a null logger (that prints nothing) or a standard logger (from the log package) with project-specific output.
type Log ¶
type Log interface {
Print(v ...interface{})
Printf(format string, v ...interface{})
Println(v ...interface{})
Fatal(v ...interface{})
Fatalf(format string, v ...interface{})
Fatalln(v ...interface{})
Panicf(format string, v ...interface{})
Panicln(v ...interface{})
}
Log is the interface for all general logging methods.
type Logger ¶
Logger is almost identical to Log except that it also contains the Write(p []byte) method so it can satisfy tye io.Writer interface. At some point, these two types should probably be combined.
type NullLogger ¶
type NullLogger struct{}
NullLogger is an exported symbol for the nullLogger struct.
func (*NullLogger) Fatalf ¶
func (nl *NullLogger) Fatalf(format string, v ...interface{})
Fatalf fatalfs.
func (*NullLogger) Panicf ¶
func (nl *NullLogger) Panicf(format string, v ...interface{})
Panicf panicfs.
func (*NullLogger) Printf ¶
func (nl *NullLogger) Printf(format string, v ...interface{})
Printf printfs.
type OutWriter ¶
type OutWriter struct {
Log
// contains filtered or unexported fields
}
An OutWriter is responsible for for implementing the io.Writer interface.
func NewOutWriter ¶
NewOutWriter accepts a logger and a format string and returns an OutWriter. When written to, the OutWriter will take the input, split it into lines, and print it to the logger using the provided format string. The intended use case of this functionality is for printing nice, colorful messages