Documentation ¶
Index ¶
- func GetLogLevelName(level LogLevel) (string, error)
- func HandlePanicWithLog(withLog ILogger)
- type CloudwatchLogger
- func (l *CloudwatchLogger) Close()
- func (l *CloudwatchLogger) Debugf(format string, a ...interface{})
- func (l *CloudwatchLogger) Errorf(format string, a ...interface{})
- func (l *CloudwatchLogger) GetLogLevel() LogLevel
- func (l *CloudwatchLogger) Infof(format string, a ...interface{})
- func (l *CloudwatchLogger) Printf(level LogLevel, format string, a ...interface{})
- func (l *CloudwatchLogger) SetLogLevel(level LogLevel)
- type ILogger
- type LogLevel
- type NullLogger
- func (l *NullLogger) Close()
- func (l *NullLogger) Debugf(format string, a ...interface{})
- func (l *NullLogger) Errorf(format string, a ...interface{})
- func (l *NullLogger) GetLogLevel() LogLevel
- func (l *NullLogger) Infof(format string, a ...interface{})
- func (l *NullLogger) Printf(level LogLevel, format string, a ...interface{})
- func (l *NullLogger) SetLogLevel(level LogLevel)
- type StdOutLogger
- func (l *StdOutLogger) Close()
- func (l *StdOutLogger) Debugf(format string, a ...interface{})
- func (l *StdOutLogger) Errorf(format string, a ...interface{})
- func (l *StdOutLogger) GetLogLevel() LogLevel
- func (l *StdOutLogger) Infof(format string, a ...interface{})
- func (l *StdOutLogger) Printf(level LogLevel, format string, a ...interface{})
- func (l *StdOutLogger) SetLogLevel(level LogLevel)
- type StdOutLoggerForTest
- func (l *StdOutLoggerForTest) Close()
- func (l *StdOutLoggerForTest) Debugf(format string, a ...interface{})
- func (l *StdOutLoggerForTest) Errorf(format string, a ...interface{})
- func (l *StdOutLoggerForTest) GetLogLevel() LogLevel
- func (l *StdOutLoggerForTest) Infof(format string, a ...interface{})
- func (l *StdOutLoggerForTest) LastLogLine() string
- func (l *StdOutLoggerForTest) LogContains(txt string) bool
- func (l *StdOutLoggerForTest) Printf(level LogLevel, format string, a ...interface{})
- func (l *StdOutLoggerForTest) SetLogLevel(level LogLevel)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetLogLevelName ¶ added in v2.0.8
func HandlePanicWithLog ¶ added in v2.0.8
func HandlePanicWithLog(withLog ILogger)
This can be called from anywhere that wants to handle a panic gracefully and ensure that any logging is done (eg completing sending to cloudwatch)
Types ¶
type CloudwatchLogger ¶
type CloudwatchLogger struct {
// contains filtered or unexported fields
}
CloudwatchLogger - Structure holding API logger internals
func (*CloudwatchLogger) Close ¶
func (l *CloudwatchLogger) Close()
func (*CloudwatchLogger) Debugf ¶
func (l *CloudwatchLogger) Debugf(format string, a ...interface{})
Debugf - Print debug to log, with format string
func (*CloudwatchLogger) Errorf ¶
func (l *CloudwatchLogger) Errorf(format string, a ...interface{})
Errorf - Print error to log, with format string
func (*CloudwatchLogger) GetLogLevel ¶ added in v2.0.8
func (l *CloudwatchLogger) GetLogLevel() LogLevel
func (*CloudwatchLogger) Infof ¶
func (l *CloudwatchLogger) Infof(format string, a ...interface{})
Infof - Print info to log, with format string
func (*CloudwatchLogger) Printf ¶
func (l *CloudwatchLogger) Printf(level LogLevel, format string, a ...interface{})
Log enqueues a log message to be written to a log stream.
The log message must be less than 1,048,550 bytes, and the time must not be more than 2 hours in the future, 14 days in the past, or older than the retention period of the log group.
This method is safe for concurrent access by multiple goroutines.
func (*CloudwatchLogger) SetLogLevel ¶ added in v2.0.8
func (l *CloudwatchLogger) SetLogLevel(level LogLevel)
type ILogger ¶
type ILogger interface { Printf(level LogLevel, format string, a ...interface{}) Debugf(format string, a ...interface{}) Infof(format string, a ...interface{}) Errorf(format string, a ...interface{}) SetLogLevel(level LogLevel) GetLogLevel() LogLevel Close() }
ILogger - Generic logger interface
type NullLogger ¶
type NullLogger struct { }
NullLogger - For mocking out in tests
func (*NullLogger) Close ¶ added in v2.0.8
func (l *NullLogger) Close()
func (*NullLogger) Debugf ¶
func (l *NullLogger) Debugf(format string, a ...interface{})
func (*NullLogger) Errorf ¶
func (l *NullLogger) Errorf(format string, a ...interface{})
func (*NullLogger) GetLogLevel ¶ added in v2.0.8
func (l *NullLogger) GetLogLevel() LogLevel
func (*NullLogger) Infof ¶
func (l *NullLogger) Infof(format string, a ...interface{})
func (*NullLogger) Printf ¶
func (l *NullLogger) Printf(level LogLevel, format string, a ...interface{})
func (*NullLogger) SetLogLevel ¶ added in v2.0.8
func (l *NullLogger) SetLogLevel(level LogLevel)
type StdOutLogger ¶
type StdOutLogger struct {
// contains filtered or unexported fields
}
StdOutLogger - For mocking out in tests
func (*StdOutLogger) Close ¶ added in v2.0.8
func (l *StdOutLogger) Close()
func (*StdOutLogger) Debugf ¶
func (l *StdOutLogger) Debugf(format string, a ...interface{})
func (*StdOutLogger) Errorf ¶
func (l *StdOutLogger) Errorf(format string, a ...interface{})
func (*StdOutLogger) GetLogLevel ¶ added in v2.0.8
func (l *StdOutLogger) GetLogLevel() LogLevel
func (*StdOutLogger) Infof ¶
func (l *StdOutLogger) Infof(format string, a ...interface{})
func (*StdOutLogger) Printf ¶
func (l *StdOutLogger) Printf(level LogLevel, format string, a ...interface{})
func (*StdOutLogger) SetLogLevel ¶ added in v2.0.8
func (l *StdOutLogger) SetLogLevel(level LogLevel)
type StdOutLoggerForTest ¶ added in v2.0.8
type StdOutLoggerForTest struct {
// contains filtered or unexported fields
}
StdOutLoggerForTest - For mocking out in tests, but saves logs so they are searchable
func (*StdOutLoggerForTest) Close ¶ added in v2.0.8
func (l *StdOutLoggerForTest) Close()
func (*StdOutLoggerForTest) Debugf ¶ added in v2.0.8
func (l *StdOutLoggerForTest) Debugf(format string, a ...interface{})
func (*StdOutLoggerForTest) Errorf ¶ added in v2.0.8
func (l *StdOutLoggerForTest) Errorf(format string, a ...interface{})
func (*StdOutLoggerForTest) GetLogLevel ¶ added in v2.0.8
func (l *StdOutLoggerForTest) GetLogLevel() LogLevel
func (*StdOutLoggerForTest) Infof ¶ added in v2.0.8
func (l *StdOutLoggerForTest) Infof(format string, a ...interface{})
func (*StdOutLoggerForTest) LastLogLine ¶ added in v2.0.8
func (l *StdOutLoggerForTest) LastLogLine() string
Checking logs (for tests)
func (*StdOutLoggerForTest) LogContains ¶ added in v2.0.8
func (l *StdOutLoggerForTest) LogContains(txt string) bool
func (*StdOutLoggerForTest) Printf ¶ added in v2.0.8
func (l *StdOutLoggerForTest) Printf(level LogLevel, format string, a ...interface{})
func (*StdOutLoggerForTest) SetLogLevel ¶ added in v2.0.8
func (l *StdOutLoggerForTest) SetLogLevel(level LogLevel)