Documentation ¶
Index ¶
- Constants
- func InitializeLogger(logVerbose bool)
- func InitializeMetricExporter()
- type BaseLogger
- func (b *BaseLogger) Debug(args ...interface{})
- func (b *BaseLogger) Debugf(template string, args ...interface{})
- func (b *BaseLogger) Error(args ...interface{})
- func (b *BaseLogger) Errorf(template string, args ...interface{})
- func (b *BaseLogger) Fatal(args ...interface{})
- func (b *BaseLogger) Fatalf(template string, args ...interface{})
- func (b *BaseLogger) Info(args ...interface{})
- func (b *BaseLogger) Infof(template string, args ...interface{})
Constants ¶
const ( // VerboseLogLevel defines verbose log level as 10 VerboseLogLevel glog.Level = 10 )
Variables ¶
This section is empty.
Functions ¶
func InitializeLogger ¶
func InitializeLogger(logVerbose bool)
InitializeLogger initializes the base logger
func InitializeMetricExporter ¶
func InitializeMetricExporter()
InitializeMetricExporter initializes the metric exporter logger
Types ¶
type BaseLogger ¶
type BaseLogger struct {
Logger *zap.SugaredLogger
}
BaseLogger is a common knative test files logger.
func GetContextLogger ¶
func GetContextLogger(context string) *BaseLogger
GetContextLogger creates a Named logger (https://godoc.org/go.uber.org/zap#Logger.Named) using the provided context as a name. This will also register the logger as a metric exporter, which is unfortunately global, so calling `GetContextLogger` will have the side effect of changing the context in which all metrics are logged from that point forward.
func (*BaseLogger) Debug ¶
func (b *BaseLogger) Debug(args ...interface{})
Debug logs a debug message.
func (*BaseLogger) Debugf ¶
func (b *BaseLogger) Debugf(template string, args ...interface{})
Debugf logs a templated debug message.
func (*BaseLogger) Error ¶
func (b *BaseLogger) Error(args ...interface{})
Error logs an error message.
func (*BaseLogger) Errorf ¶
func (b *BaseLogger) Errorf(template string, args ...interface{})
Errorf logs a templated error message.
func (*BaseLogger) Fatal ¶
func (b *BaseLogger) Fatal(args ...interface{})
Fatal logs a fatal message.
func (*BaseLogger) Fatalf ¶
func (b *BaseLogger) Fatalf(template string, args ...interface{})
Fatalf logs a templated fatal message.
func (*BaseLogger) Infof ¶
func (b *BaseLogger) Infof(template string, args ...interface{})
Infof logs a templated message.