go-challenge/main.go

23 lines
422 B
Go
Raw Normal View History

2022-10-21 12:02:03 -05:00
package main
import (
log "github.com/sirupsen/logrus"
"os"
)
func init() {
log.SetFormatter(&log.JSONFormatter{})
log.SetOutput(os.Stdout)
desiredLogLevel := os.Getenv("LOG_LEVEL")
level, err := log.ParseLevel(desiredLogLevel)
if err != nil {
log.Errorf("Failed to parse log level: %s", desiredLogLevel)
log.SetLevel(log.InfoLevel)
} else {
log.SetLevel(level)
}
}
func main() {
_, _ = AllStarships()
}