23 lines
422 B
Go
23 lines
422 B
Go
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()
|
|
} |