func New(out io.Writer, build, env, sentryDSN string) Logger {
	logger := logrus.New()
	logger.Out = out
	switch env {
	case "production":
		logger.Formatter = &logrus.JSONFormatter{}
		logger.Level = logrus.InfoLevel
	default:
		logger.Formatter = &logrus.TextFormatter{}
		logger.Level = logrus.DebugLevel
	}
	ctxLogger := logger.WithField("logger", "gci")
	if hostname, err := os.Hostname(); err == nil {
		ctxLogger = ctxLogger.WithField("server_name", hostname)
	}
	if sentryDSN != "" {
		hook, err := logrus_sentry.NewSentryHook(sentryDSN, []logrus.Level{
			logrus.PanicLevel,
			logrus.FatalLevel,
			logrus.ErrorLevel,
		})
		hook.SetEnvironment(env)
		hook.SetRelease(build)
		hook.StacktraceConfiguration.Enable = true
		hook.StacktraceConfiguration.Level = logrus.ErrorLevel  
		hook.Timeout = 1 * time.Second                          
		if err != nil {
			logger.WithError(err).Fatal("could not setup sentry logrus")
		}
		logger.Hooks.Add(hook)
		ctxLogger.WithField("area", "logger").Info("enabled sentry")
	}
	return &log{
		logrus: ctxLogger,
	}
}
New constructs a new Logger.
package logger
import (
	"io"
	"os"
	"time"
	"github.com/evalphobia/logrus_sentry"
	"github.com/sirupsen/logrus"
)
type Logger interface {
	Debug(args ...interface{})
	Debugf(format string, args ...interface{})
	Info(args ...interface{})
	Infof(format string, args ...interface{})
	Error(args ...interface{})
	Errorf(format string, args ...interface{})
	Fatal(args ...interface{})
	Fatalf(format string, args ...interface{})
	With(name string, value interface{}) Logger
}
type log struct {
	logrus *logrus.Entry
}