Exemplo n.º 1
0
// Logger returns the log15 logger stored in the given context if any, nil otherwise.
func Logger(ctx context.Context) log15.Logger {
	logger := goa.ContextLogger(ctx)
	if a, ok := logger.(*adapter); ok {
		return a.Logger
	}
	return nil
}
Exemplo n.º 2
0
// Entry returns the logrus log entry stored in the given context if any, nil otherwise.
func Entry(ctx context.Context) *logrus.Entry {
	logger := goa.ContextLogger(ctx)
	if a, ok := logger.(*adapter); ok {
		return a.Entry
	}
	return nil
}
Exemplo n.º 3
0
// Context returns the go-kit log context stored in the given context if any, nil otherwise.
func Context(ctx context.Context) *log.Context {
	logger := goa.ContextLogger(ctx)
	if a, ok := logger.(*adapter); ok {
		return a.Context
	}
	return nil
}