Documentation ¶
Overview ¶
Package logging handles logging throughout Atlantis.
Index ¶
- type LogLevel
- type SimpleLogger
- func (l *SimpleLogger) Debug(format string, a ...interface{})
- func (l *SimpleLogger) Err(format string, a ...interface{})
- func (l *SimpleLogger) Info(format string, a ...interface{})
- func (l *SimpleLogger) Log(level LogLevel, format string, a ...interface{})
- func (l *SimpleLogger) Warn(format string, a ...interface{})
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LogLevel ¶
type LogLevel int
func ToLogLevel ¶
ToLogLevel converts a log level string to a valid LogLevel object. If the string doesn't match a level, it will return Info.
type SimpleLogger ¶
type SimpleLogger struct { // Source is added as a prefix to each log entry. // It's useful if you want to trace a log entry back to a // context, for example a pull request id. Source string // History stores all log entries ever written using // this logger. This is safe for short-lived loggers // like those used during plan/apply commands. History bytes.Buffer Logger *log.Logger KeepHistory bool Level LogLevel }
SimpleLogger wraps the standard logger with leveled logging and the ability to store log history for later adding it to a GitHub comment.
func NewSimpleLogger ¶
func NewSimpleLogger(source string, logger *log.Logger, keepHistory bool, level LogLevel) *SimpleLogger
NewSimpleLogger creates a new logger.
- source is added as a prefix to each log entry. It's useful if you want to trace a log entry back to a context, for example a pull request id.
- logger is the underlying logger.
- keepHistory set to true will store all log entries written using this logger.
- level will set the level at which logs >= than that level will be written. If keepHistory is set to true, we'll store logs at all levels, regardless of what level is set to.
func (*SimpleLogger) Debug ¶
func (l *SimpleLogger) Debug(format string, a ...interface{})
func (*SimpleLogger) Err ¶
func (l *SimpleLogger) Err(format string, a ...interface{})
func (*SimpleLogger) Info ¶
func (l *SimpleLogger) Info(format string, a ...interface{})
func (*SimpleLogger) Log ¶
func (l *SimpleLogger) Log(level LogLevel, format string, a ...interface{})
func (*SimpleLogger) Warn ¶
func (l *SimpleLogger) Warn(format string, a ...interface{})
Click to show internal directories.
Click to hide internal directories.