add web log

This commit is contained in:
YouROK
2021-04-27 10:52:32 +03:00
parent 5f4b702a1a
commit df1d2e4d2f
4 changed files with 97 additions and 16 deletions

View File

@@ -17,13 +17,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"`
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"`
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"`
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"`
}
func (args) Version() string {
@@ -45,7 +46,7 @@ func main() {
settings.Path = params.Path
settings.HttpAuth = params.HttpAuth
log.Init(params.LogPath)
log.Init(params.LogPath, params.WebLogPath)
dnsResolve()
Preconfig(params.DontKill)
@@ -59,6 +60,7 @@ func main() {
server.Start(params.Port, params.RDB)
log.TLogln(server.WaitServer())
log.Close()
time.Sleep(time.Second * 3)
os.Exit(0)
}