Documentation ¶
Overview ¶
Package io provides a means of turning a log.Logger into an io.Writer for a chosen level. An example of this would be:
import( "io" "github.com/Masterminds/log-go" logio "github.com/Masterminds/log-go/io" ) func main() { w := logio.NewCurrentWriter(log.InfoLevel) io.WriteString(w, "foo") }
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CurrentWriter ¶
type CurrentWriter struct {
Level int
}
CurrentWriter uses the current package level logger for io writing
func NewCurrentWriter ¶
func NewCurrentWriter(level int) *CurrentWriter
NewCurrentWriter creates a new CurrentWriter. The levels that can be passed to it are: - log.TraceLevel: - log.DebugLevel: - log.InfoLevel: - log.WarnLevel: - log.ErrorLevel: - log.PanicLevel: - log.FatalLevel:
type Writer ¶
type Writer struct { Logger log.Logger Level int }
Writer uses the configured logger for io writing
Click to show internal directories.
Click to hide internal directories.