Documentation ¶
Index ¶
- type Logger
- func (l *Logger) Debug(msg string, args ...interface{})
- func (l *Logger) Error(msg string, args ...interface{})
- func (l *Logger) ImpliedArgs() []interface{}
- func (l *Logger) Info(msg string, args ...interface{})
- func (l *Logger) IsDebug() bool
- func (l *Logger) IsError() bool
- func (l *Logger) IsInfo() bool
- func (l *Logger) IsTrace() bool
- func (l *Logger) IsWarn() bool
- func (l *Logger) Log(level hclog.Level, msg string, args ...interface{})
- func (l *Logger) Name() string
- func (l *Logger) Named(name string) hclog.Logger
- func (l *Logger) ResetNamed(name string) hclog.Logger
- func (l *Logger) SetLevel(level hclog.Level)
- func (l *Logger) StandardLogger(opts *hclog.StandardLoggerOptions) *log.Logger
- func (l *Logger) StandardWriter(opts *hclog.StandardLoggerOptions) io.Writer
- func (l *Logger) Trace(msg string, args ...interface{})
- func (l *Logger) Warn(msg string, args ...interface{})
- func (l *Logger) With(args ...interface{}) hclog.Logger
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Logger ¶
type Logger struct {
// contains filtered or unexported fields
}
Logger describes the interface that must be implemeted by all loggers.
func (*Logger) ImpliedArgs ¶
func (l *Logger) ImpliedArgs() []interface{}
ImpliedArgs returns With key/value pairs.
func (*Logger) IsDebug ¶
IsDebug indicates if DEBUG logs would be emitted. This and the other Is* guards.
func (*Logger) IsError ¶
IsError indicates if ERROR logs would be emitted. This and the other Is* guards.
func (*Logger) IsInfo ¶
IsInfo indicates if INFO logs would be emitted. This and the other Is* guards.
func (*Logger) IsTrace ¶
IsTrace indicates if TRACE logs would be emitted. This and the other Is* guards are used to elide expensive logging code based on the current level.
func (*Logger) IsWarn ¶
IsWarn indicates if WARN logs would be emitted. This and the other Is* guards.
func (*Logger) Log ¶
Log sends a message to the logger. Args are alternating key, val pairs. keys must be strings. vals can be any type, but display is implementation specific. Emit a message and key/value pairs at a provided log level.
func (*Logger) Named ¶
Named creates a logger that will prepend the name string on the front of all messages. If the logger already has a name, the new value will be appended to the current name. That way, a major subsystem can use this to decorate all it's own logs without losing context.
func (*Logger) ResetNamed ¶
ResetNamed creates a logger that will prepend the name string on the front of all messages. This sets the name of the logger to the value directly, unlike Named which honor the current name as well.
func (*Logger) SetLevel ¶
func (l *Logger) SetLevel(level hclog.Level)
SetLevel updates the level. This should affect all related loggers as well, unless they were created with IndependentLevels. If an implementation cannot update the level on the fly, it should no-op.
func (*Logger) StandardLogger ¶
StandardLogger returns a value that conforms to the stdlib log.Logger interface.
func (*Logger) StandardWriter ¶
StandardWriter returns a value that conforms to io.Writer, which can be passed into log.SetOutput().