Esempio n. 1
0
func GetLogger(ctx context.Context) *logger.Logger {
	if ctx == nil {
		return logger.New(os.Stdout)
	}

	_logger, ok := ctx.Value("logger").(*logger.Logger)
	if ok {
		return _logger
	}

	return logger.New(os.Stdout)
}
Esempio n. 2
0
func TestInfof(t *testing.T) {
	logger.New(os.Stdout).Infof("this is %s", "polaris")
}