Documentation ¶
Index ¶
- type Level
- type Log
- func (l *Log) Debugf(msg string, v ...interface{})
- func (l *Log) Errorf(msg string, v ...interface{})
- func (l *Log) Infof(msg string, v ...interface{})
- func (l *Log) Printf(msg string, v ...interface{})
- func (l *Log) SetLevel(lvl Level)
- func (l *Log) Verbosef(msg string, v ...interface{})
- func (l *Log) Warnf(msg string, v ...interface{})
- type Logger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Level ¶
type Level int
Level is the logging level: None, Error, Warn, Info, Verbose, or Debug
const ( // Error means that only errors will be written // Maps to server.Error Error Level = iota // Warn means that errors and warnings will be written // Maps to server.Warning Warn // Info logging writes info, warning, and error // Maps to server.Info Info // Verbose logs everything bug debug-level messages // Maps to server.Log Verbose // Debug logs every message // Debug level messages will not be reported to the language server client Debug )
type Log ¶
type Log struct {
// contains filtered or unexported fields
}
Log is a fairly basic logger
func CreateLog ¶
CreateLog will return a log for the given name, creating one with the provided writer as needed
func (*Log) Debugf ¶
Debugf will write if the log level is at least Debug. If the pointer receiver is nil, the log for `os.Stdout` will be used.
func (*Log) Errorf ¶
Errorf will write if the log level is at least Error. If the pointer receiver is nil, the log for `os.Stdout` will be used.
func (*Log) Infof ¶
Infof will write if the log level is at least Info. If the pointer receiver is nil, the log for `os.Stdout` will be used.
func (*Log) Printf ¶
Printf will always log the given message, regardless of log level set. If the pointer receiver is nil, the log for `os.Stdout` will be used.
func (*Log) SetLevel ¶
SetLevel will adjust the logger's level. If the pointer receiver is nil, the log for `os.Stdout` will be used.
type Logger ¶
type Logger interface { // Debugf will write if the log level is at least Debug. Debugf(msg string, v ...interface{}) // Errorf will write if the log level is at least Error. Errorf(msg string, v ...interface{}) // Infof will write if the log level is at least Info. Infof(msg string, v ...interface{}) // Printf will always log the given message, regardless of log level set. Printf(msg string, v ...interface{}) // SetLevel will adjust the logger's level. SetLevel(lvl Level) // Verbosef will write if the log level is at least Verbose. Verbosef(msg string, v ...interface{}) // Warnf will write if the log level is at least Warn. Warnf(msg string, v ...interface{}) }