suport for webdav

This commit is contained in:
A.Unger
2021-03-17 15:40:23 +01:00
parent 9daf14e124
commit 094af97b95
3 changed files with 9 additions and 0 deletions
+2
View File
@@ -61,6 +61,7 @@ func NewLogger(cfg *config.Config) log.Logger {
log.Level(cfg.Log.Level), log.Level(cfg.Log.Level),
log.Pretty(cfg.Log.Pretty), log.Pretty(cfg.Log.Pretty),
log.Color(cfg.Log.Color), log.Color(cfg.Log.Color),
log.File(cfg.Log.File),
) )
} }
@@ -119,6 +120,7 @@ func NewSutureService(cfg *ociscfg.Config) suture.Service {
if cfg.Mode == 0 { if cfg.Mode == 0 {
cfg.WebDAV.Supervised = true cfg.WebDAV.Supervised = true
} }
cfg.WebDAV.Log.File = cfg.Log.File
return SutureService{ return SutureService{
cfg: cfg.WebDAV, cfg: cfg.WebDAV,
} }
+1
View File
@@ -7,6 +7,7 @@ type Log struct {
Level string Level string
Pretty bool Pretty bool
Color bool Color bool
File string
} }
// Debug defines the available debug configuration. // Debug defines the available debug configuration.
+6
View File
@@ -22,6 +22,12 @@ func HealthWithConfig(cfg *config.Config) []cli.Flag {
// ServerWithConfig applies cfg to the root flagset // ServerWithConfig applies cfg to the root flagset
func ServerWithConfig(cfg *config.Config) []cli.Flag { func ServerWithConfig(cfg *config.Config) []cli.Flag {
return []cli.Flag{ return []cli.Flag{
&cli.StringFlag{
Name: "log-file",
Usage: "Enable log to file",
EnvVars: []string{"WEBDAV_LOG_FILE", "OCIS_LOG_FILE"},
Destination: &cfg.Log.File,
},
&cli.StringFlag{ &cli.StringFlag{
Name: "log-level", Name: "log-level",
Usage: "Set logging level", Usage: "Set logging level",