From 7055f0c9b29a601dd1f6e2e62a443ce387486298 Mon Sep 17 00:00:00 2001 From: Jakob Schrettenbrunner Date: Mon, 26 Jun 2017 20:44:37 +0200 Subject: [PATCH] update import paths update Readme with shields --- README.md | 2 +- api/api.go | 4 ++-- environments/docker.go | 2 +- main.go | 17 ++++++++++------- services/service.go | 2 +- tools/logging.go | 7 +++++-- 6 files changed, 20 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 8eb3a91..257ec9c 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,2 @@ -# pterodactyld +# wings.go ![travis](https://img.shields.io/travis/schrej/wings.svg?style=flat-square) ![codacy quality](https://img.shields.io/codacy/grade/27a1576bda86450f853b1052b12fa570.svg?style=flat-square) ![codacy coverage](https://img.shields.io/codacy/coverage/27a1576bda86450f853b1052b12fa570.svg?style=flat-square) A new generation of the Pterodactyl daemon, written in go diff --git a/api/api.go b/api/api.go index bc02fb4..1158db0 100644 --- a/api/api.go +++ b/api/api.go @@ -5,9 +5,9 @@ import ( "html" "net/http" - log "github.com/Sirupsen/logrus" + log "github.com/sirupsen/logrus" - "github.com/schrej/wings.go/config" + "github.com/schrej/wings/config" ) // API is a grouping struct for the api diff --git a/environments/docker.go b/environments/docker.go index 135058d..fd2bfe2 100644 --- a/environments/docker.go +++ b/environments/docker.go @@ -9,7 +9,7 @@ func NewDockerEnvironment() *DockerEnvironment { } func (env *DockerEnvironment) Exec() error { - + return nil } func (env *DockerEnvironment) Create() error { diff --git a/main.go b/main.go index cdd25cd..18f37d2 100644 --- a/main.go +++ b/main.go @@ -1,10 +1,12 @@ package main import ( - log "github.com/Sirupsen/logrus" - "github.com/schrej/wings.go/api" - "github.com/schrej/wings.go/config" - "github.com/schrej/wings.go/tools" + "fmt" + + "github.com/schrej/wings/api" + "github.com/schrej/wings/config" + "github.com/schrej/wings/tools" + log "github.com/sirupsen/logrus" ) const ( @@ -13,15 +15,16 @@ const ( ) func main() { + fmt.Println("Loading configuration") + if err := config.LoadConfiguration(); err != nil { + log.WithError(err).Fatal("Failed to find configuration file") + } tools.ConfigureLogging() log.Info("Starting wings.go version ", Version) // Load configuration log.Info("Loading configuration...") - if err := config.LoadConfiguration(); err != nil { - log.WithError(err).Fatal("Failed to find configuration file") - } log.Info("Starting api webserver") api := api.NewAPI() diff --git a/services/service.go b/services/service.go index 53a4a90..02fa908 100644 --- a/services/service.go +++ b/services/service.go @@ -1,6 +1,6 @@ package services -import "github.com/schrej/wings.go/environments" +import "github.com/schrej/wings/environments" type Service struct { Environment environments.Environment diff --git a/tools/logging.go b/tools/logging.go index 721e1e8..81fdc76 100644 --- a/tools/logging.go +++ b/tools/logging.go @@ -5,10 +5,11 @@ import ( rotatelogs "github.com/lestrrat/go-file-rotatelogs" "github.com/rifflock/lfshook" - log "github.com/Sirupsen/logrus" + log "github.com/sirupsen/logrus" ) -func ConfigureLogging() { +// ConfigureLogging configures logrus to our needs +func ConfigureLogging() error { log.SetFormatter(&log.TextFormatter{ DisableTimestamp: true, @@ -28,4 +29,6 @@ func ConfigureLogging() { log.FatalLevel: writer, log.PanicLevel: writer, })) + + return nil }