auto-deploy-service/pkg/logger/logger.go

25 lines
308 B
Go
Raw Permalink Normal View History

2021-06-13 14:59:50 +00:00
package logger
import (
"io"
"os"
"github.com/sirupsen/logrus"
)
func NewLogger(output io.Writer) *logrus.Logger {
l := logrus.New()
l.SetFormatter(&logrus.TextFormatter{})
l.SetLevel(logrus.DebugLevel)
if output != nil {
l.SetOutput(output)
} else {
l.SetOutput(os.Stdout)
}
return l
}