Documentation ¶
Overview ¶
Package log provides a utility to log timestamped messages to an io.Writer.
Index ¶
- Constants
- func IsInVerbosity(minVerb int) bool
- func Logv(minVerb int, msg string)
- func Logvf(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) Logv(minVerb int, msg string)
- func (tl *ToolLogger) Logvf(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 IsInVerbosity ¶
IsInVerbosity returns true if the current verbosity level setting is greater than or equal to the given level.
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) Logv ¶
func (tl *ToolLogger) Logv(minVerb int, msg string)
func (*ToolLogger) Logvf ¶
func (tl *ToolLogger) Logvf(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.