From b7682545e1b9bd08585111b20200a39a512e27c1 Mon Sep 17 00:00:00 2001 From: nikk gitanes Date: Sun, 15 Aug 2021 08:47:21 +0300 Subject: [PATCH] update options desc and log --- server/cmd/main.go | 14 +++++++------- server/cmd/preconfig_pos.go | 8 ++++---- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/server/cmd/main.go b/server/cmd/main.go index 821727e..14a0aa0 100644 --- a/server/cmd/main.go +++ b/server/cmd/main.go @@ -22,14 +22,14 @@ import ( type args struct { Port string `arg:"-p" help:"web server port"` - Path string `arg:"-d" help:"database path"` - LogPath string `arg:"-l" help:"log path"` - WebLogPath string `arg:"-w" help:"web log path"` + Path string `arg:"-d" help:"database dir path"` + LogPath string `arg:"-l" help:"server log file path"` + WebLogPath string `arg:"-w" help:"web access log file path"` RDB bool `arg:"-r" help:"start in read-only DB mode"` - HttpAuth bool `arg:"-a" help:"http auth on all requests"` - DontKill bool `arg:"-k" help:"dont kill server on signal"` - UI bool `arg:"-u" help:"run page torrserver in browser"` - TorrentsDir string `arg:"-t" help:"autoload torrent from dir"` + HttpAuth bool `arg:"-a" help:"enable http auth on all requests"` + DontKill bool `arg:"-k" help:"don't kill server on signal"` + UI bool `arg:"-u" help:"open torrserver page in browser"` + TorrentsDir string `arg:"-t" help:"autoload torrents from dir"` } func (args) Version() string { diff --git a/server/cmd/preconfig_pos.go b/server/cmd/preconfig_pos.go index a0be9fc..e3aa953 100644 --- a/server/cmd/preconfig_pos.go +++ b/server/cmd/preconfig_pos.go @@ -3,10 +3,11 @@ package main import ( - "fmt" "os" "os/signal" "syscall" + + "server/log" ) func Preconfig(dkill bool) { @@ -15,15 +16,14 @@ func Preconfig(dkill bool) { signal.Notify(sigc, syscall.SIGHUP, syscall.SIGINT, - syscall.SIGPIPE, syscall.SIGTERM, syscall.SIGQUIT) go func() { for s := range sigc { if dkill { - fmt.Println("Signal catched:", s) - fmt.Println("For stop server, close in api") + log.TLogln("Signal catched:", s) + log.TLogln("To stop server, close it from web / api") } } }()