Documentation ¶
Index ¶
- Constants
- func LoggerAsHCLogger(l Logger) hclog.Logger
- type CharmLogger
- func (l *CharmLogger) Debug(message string, keyvals ...interface{})
- func (l *CharmLogger) Error(message string, keyvals ...interface{})
- func (l *CharmLogger) Info(message string, keyvals ...interface{})
- func (l *CharmLogger) IsDebug() bool
- func (l *CharmLogger) IsError() bool
- func (l *CharmLogger) IsInfo() bool
- func (l *CharmLogger) IsTrace() bool
- func (l *CharmLogger) IsWarn() bool
- func (l *CharmLogger) Level() string
- func (l *CharmLogger) Output() io.Writer
- func (l *CharmLogger) SetLevel(level string)
- func (l *CharmLogger) SetOutput(w io.Writer)
- func (l *CharmLogger) StandardWriter() io.Writer
- func (l *CharmLogger) Trace(message string, keyvals ...interface{})
- func (l *CharmLogger) Warn(message string, keyvals ...interface{})
- type Logger
- type NullLogger
Constants ¶
View Source
const ( LogLevelInfo = "info" LogLevelDebug = "debug" LogLevelTrace = "trace" LogLevelWarn = "warn" LogLevelError = "error" )
Variables ¶
This section is empty.
Functions ¶
func LoggerAsHCLogger ¶
func LoggerAsHCLogger(l Logger) hclog.Logger
Types ¶
type CharmLogger ¶
type CharmLogger struct {
// contains filtered or unexported fields
}
func (*CharmLogger) Debug ¶
func (l *CharmLogger) Debug(message string, keyvals ...interface{})
func (*CharmLogger) Error ¶
func (l *CharmLogger) Error(message string, keyvals ...interface{})
func (*CharmLogger) Info ¶
func (l *CharmLogger) Info(message string, keyvals ...interface{})
func (*CharmLogger) IsDebug ¶
func (l *CharmLogger) IsDebug() bool
func (*CharmLogger) IsError ¶
func (l *CharmLogger) IsError() bool
func (*CharmLogger) IsInfo ¶
func (l *CharmLogger) IsInfo() bool
func (*CharmLogger) IsTrace ¶
func (l *CharmLogger) IsTrace() bool
func (*CharmLogger) IsWarn ¶
func (l *CharmLogger) IsWarn() bool
func (*CharmLogger) Level ¶
func (l *CharmLogger) Level() string
func (*CharmLogger) Output ¶
func (l *CharmLogger) Output() io.Writer
func (*CharmLogger) SetLevel ¶
func (l *CharmLogger) SetLevel(level string)
func (*CharmLogger) SetOutput ¶
func (l *CharmLogger) SetOutput(w io.Writer)
func (*CharmLogger) StandardWriter ¶
func (l *CharmLogger) StandardWriter() io.Writer
func (*CharmLogger) Trace ¶
func (l *CharmLogger) Trace(message string, keyvals ...interface{})
func (*CharmLogger) Warn ¶
func (l *CharmLogger) Warn(message string, keyvals ...interface{})
type Logger ¶
type Logger interface { // Set the logger level SetLevel(level string) Level() string // Set the logger output SetOutput(w io.Writer) Output() io.Writer // Info logs to info level Info(message string, keyvals ...interface{}) // Debug logs to debug level Debug(message string, keyvals ...interface{}) // Error logs to error level Error(message string, keyvals ...interface{}) // Warn logs to warn level Warn(message string, keyvals ...interface{}) // Trace logs to trace level Trace(message string, keyvals ...interface{}) StandardWriter() io.Writer IsInfo() bool IsDebug() bool IsError() bool IsTrace() bool IsWarn() bool }
Logger defines a abstract logger that can be used to log to the output
func NewTTYLogger ¶
NewTTYLogger creates a new logger with full TTY colors
func NewTestLogger ¶
Logger that sends all output to a string buffer the captured log output can be retrieved by accessing the string buffer at LogOutput In the instance of a test failure, the log output is written to StdOut
type NullLogger ¶
Click to show internal directories.
Click to hide internal directories.