Improve binary names and output logs

Signed-off-by: Antonio Navarro Perez <antnavper@gmail.com>
This commit is contained in:
Antonio Navarro Perez 2020-08-02 21:38:53 +02:00
parent f6539aab06
commit f6d7a5fff2
3 changed files with 7 additions and 4 deletions

View file

@ -39,17 +39,17 @@ go-compile:
# MacOS # MacOS
#GOOS=darwin GOARCH=386 go build $(LDFLAGS) -o bin/main-darwin-386 -tags "release" cmd/distribyted/main.go #GOOS=darwin GOARCH=386 go build $(LDFLAGS) -o bin/main-darwin-386 -tags "release" cmd/distribyted/main.go
# Linux # Linux
GOOS=linux GOARCH=386 go build $(LDFLAGS) -o bin/main-linux-386 -tags "release" cmd/distribyted/main.go GOOS=linux GOARCH=386 go build $(LDFLAGS) -o bin/distribyted-linux-386 -tags "release" cmd/distribyted/main.go
# 64-Bit # 64-Bit
# FreeBDS # FreeBDS
#GOOS=freebsd GOARCH=amd64 go build $(LDFLAGS) -o bin/main-freebsd-amd64 -tags "release" cmd/distribyted/main.go #GOOS=freebsd GOARCH=amd64 go build $(LDFLAGS) -o bin/main-freebsd-amd64 -tags "release" cmd/distribyted/main.go
# MacOS # MacOS
#GOOS=darwin GOARCH=amd64 go build $(LDFLAGS) -o bin/main-darwin-amd64 -tags "release" cmd/distribyted/main.go #GOOS=darwin GOARCH=amd64 go build $(LDFLAGS) -o bin/main-darwin-amd64 -tags "release" cmd/distribyted/main.go
# Linux # Linux
GOOS=linux GOARCH=amd64 go build $(LDFLAGS) -o bin/main-linux-amd64 -tags "release" cmd/distribyted/main.go GOOS=linux GOARCH=amd64 go build $(LDFLAGS) -o bin/distribyted-linux-amd64 -tags "release" cmd/distribyted/main.go
# ARM # ARM
GOOS=linux GOARCH=arm GOARM=5 go build $(LDFLAGS) -o bin/main-linux-arm -tags "release" cmd/distribyted/main.go GOOS=linux GOARCH=arm GOARM=5 go build $(LDFLAGS) -o bin/distribyted-linux-arm -tags "release" cmd/distribyted/main.go
.PHONY: help .PHONY: help
all: help all: help

View file

@ -136,11 +136,14 @@ func main() {
ctx.JSON(200, stats) ctx.JSON(200, stats)
}) })
log.WithField("host", "0.0.0.0:4444").Info("starting webserver")
//TODO add port from configuration //TODO add port from configuration
if err := r.Run(":4444"); err != nil { if err := r.Run(":4444"); err != nil {
log.WithError(err).Error("error initializing server") log.WithError(err).Error("error initializing server")
return return
} }
} }
func tryClose(log *logrus.Logger, c *torrent.Client, mountService *mount.Handler) { func tryClose(log *logrus.Logger, c *torrent.Client, mountService *mount.Handler) {

View file

@ -58,7 +58,7 @@ func (s *Handler) Mount(mpc *config.MountPoint) error {
} }
s.s.Add(mpc.Path, t) s.s.Add(mpc.Path, t)
log.WithField("name", t.Name()).Info("torrent added") log.WithField("name", t.Name()).WithField("path", mpc.Path).Info("torrent added to mountpoint")
torrents = append(torrents, t) torrents = append(torrents, t)
} }