cloudapi: use Logrus as default logger in Echo
And remove log.Logger references
This commit is contained in:
parent
75372b98e1
commit
179009fec4
9 changed files with 198 additions and 15 deletions
|
|
@ -6,6 +6,7 @@ import (
|
|||
"os"
|
||||
|
||||
"github.com/coreos/go-systemd/activation"
|
||||
"github.com/sirupsen/logrus"
|
||||
)
|
||||
|
||||
const (
|
||||
|
|
@ -34,10 +35,19 @@ func main() {
|
|||
if os.IsNotExist(err) {
|
||||
config = &ComposerConfigFile{}
|
||||
} else {
|
||||
log.Fatalf("Error loading configuration: %v", err)
|
||||
logrus.Fatalf("Error loading configuration: %v", err)
|
||||
}
|
||||
}
|
||||
|
||||
logrus.SetOutput(os.Stdout)
|
||||
logLevel, err := logrus.ParseLevel(config.logLevel)
|
||||
|
||||
if err == nil {
|
||||
logrus.SetLevel(logLevel)
|
||||
} else {
|
||||
logrus.Info("Failed to load loglevel from config:", err)
|
||||
}
|
||||
|
||||
log.Println("Loaded configuration:")
|
||||
err = DumpConfig(config, log.Writer())
|
||||
if err != nil {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue