add flag (-http-log) to disable http request logging

This commit is contained in:
Duncan Overbruck
2021-02-27 16:27:59 +01:00
committed by Senan Kelly
parent 7d420f61a9
commit 2a11017d54
2 changed files with 6 additions and 1 deletions

View File

@@ -32,6 +32,7 @@ type Options struct {
CoverCachePath string
ProxyPrefix string
GenreSplit string
HTTPLog bool
}
type Server struct {
@@ -60,7 +61,9 @@ func New(opts Options) *Server {
}
// router with common wares for admin / subsonic
r := mux.NewRouter()
r.Use(base.WithLogging)
if opts.HTTPLog {
r.Use(base.WithLogging)
}
r.Use(base.WithCORS)
//
sessKey := opts.DB.GetOrCreateKey("session_key")