Documentation ¶
Overview ¶
Package log provides a utility to log timestamped messages to an io.Writer.
Index ¶
- Constants
- func Log(minVerb int, msg string)
- func Logf(minVerb int, format string, a ...interface{})
- func SetDateFormat(dateFormat string)
- func SetVerbosity(verbosity VerbosityLevel)
- func SetWriter(writer io.Writer)
- func Writer(minVerb int) io.Writer
- type ToolLogger
- func (tl *ToolLogger) Log(minVerb int, msg string)
- func (tl *ToolLogger) Logf(minVerb int, format string, a ...interface{})
- func (tl *ToolLogger) SetDateFormat(dateFormat string)
- func (tl *ToolLogger) SetVerbosity(level VerbosityLevel)
- func (tl *ToolLogger) SetWriter(writer io.Writer)
- func (tl *ToolLogger) Writer(minVerb int) io.Writer
- type VerbosityLevel
Constants ¶
View Source
const ( Always = iota Info DebugLow DebugHigh )
Tool Logger verbosity constants
View Source
const (
ToolTimeFormat = "2006-01-02T15:04:05.000-0700"
)
Variables ¶
This section is empty.
Functions ¶
func SetDateFormat ¶
func SetDateFormat(dateFormat string)
func SetVerbosity ¶
func SetVerbosity(verbosity VerbosityLevel)
Types ¶
type ToolLogger ¶
type ToolLogger struct {
// contains filtered or unexported fields
}
func NewToolLogger ¶
func NewToolLogger(verbosity VerbosityLevel) *ToolLogger
func (*ToolLogger) Log ¶
func (tl *ToolLogger) Log(minVerb int, msg string)
func (*ToolLogger) Logf ¶
func (tl *ToolLogger) Logf(minVerb int, format string, a ...interface{})
func (*ToolLogger) SetDateFormat ¶
func (tl *ToolLogger) SetDateFormat(dateFormat string)
func (*ToolLogger) SetVerbosity ¶
func (tl *ToolLogger) SetVerbosity(level VerbosityLevel)
func (*ToolLogger) SetWriter ¶
func (tl *ToolLogger) SetWriter(writer io.Writer)
type VerbosityLevel ¶
Click to show internal directories.
Click to hide internal directories.