From 0a3d94f73df0ed341978e66cdc4864bca931f0b8 Mon Sep 17 00:00:00 2001 From: Nicola Murino Date: Wed, 5 Jan 2022 13:22:49 +0100 Subject: [PATCH] log at info level the service configurations Signed-off-by: Nicola Murino --- ftpd/ftpd.go | 2 +- httpd/httpd.go | 2 +- sdk/kms/kms.go | 4 ++-- service/service.go | 16 ++++++++-------- telemetry/telemetry.go | 2 +- webdavd/webdavd.go | 2 +- 6 files changed, 14 insertions(+), 14 deletions(-) diff --git a/ftpd/ftpd.go b/ftpd/ftpd.go index 7639afcd..31d597dd 100644 --- a/ftpd/ftpd.go +++ b/ftpd/ftpd.go @@ -257,7 +257,7 @@ func (c *Configuration) ShouldBind() bool { // Initialize configures and starts the FTP server func (c *Configuration) Initialize(configDir string) error { - logger.Debug(logSender, "", "initializing FTP server with config %+v", *c) + logger.Info(logSender, "", "initializing FTP server with config %+v", *c) if !c.ShouldBind() { return common.ErrNoBinding } diff --git a/httpd/httpd.go b/httpd/httpd.go index d7247f9c..af927c7f 100644 --- a/httpd/httpd.go +++ b/httpd/httpd.go @@ -453,7 +453,7 @@ func (c *Conf) getRedacted() Conf { // Initialize configures and starts the HTTP server func (c *Conf) Initialize(configDir string) error { - logger.Debug(logSender, "", "initializing HTTP server with config %+v", c.getRedacted()) + logger.Info(logSender, "", "initializing HTTP server with config %+v", c.getRedacted()) backupsPath = getConfigPath(c.BackupsPath, configDir) staticFilesPath := getConfigPath(c.StaticFilesPath, configDir) templatesPath := getConfigPath(c.TemplatesPath, configDir) diff --git a/sdk/kms/kms.go b/sdk/kms/kms.go index 7d57ac36..8d4446e4 100644 --- a/sdk/kms/kms.go +++ b/sdk/kms/kms.go @@ -444,8 +444,8 @@ func (s *Secret) TryDecrypt() error { } func isSecretStatusValid(status string) bool { - for i := 0; i < len(validSecretStatuses); i++ { - if validSecretStatuses[i] == status { + for idx := range validSecretStatuses { + if validSecretStatuses[idx] == status { return true } } diff --git a/service/service.go b/service/service.go index 214aab26..07c51399 100644 --- a/service/service.go +++ b/service/service.go @@ -168,7 +168,7 @@ func (s *Service) startServices() { go func() { redactedConf := sftpdConf redactedConf.KeyboardInteractiveHook = util.GetRedactedURL(sftpdConf.KeyboardInteractiveHook) - logger.Debug(logSender, "", "initializing SFTP server with config %+v", redactedConf) + logger.Info(logSender, "", "initializing SFTP server with config %+v", redactedConf) if err := sftpdConf.Initialize(s.ConfigDir); err != nil { logger.Error(logSender, "", "could not start SFTP server: %v", err) logger.ErrorToConsole("could not start SFTP server: %v", err) @@ -177,7 +177,7 @@ func (s *Service) startServices() { s.Shutdown <- true }() } else { - logger.Debug(logSender, "", "SFTP server not started, disabled in config file") + logger.Info(logSender, "", "SFTP server not started, disabled in config file") } if httpdConf.ShouldBind() { @@ -190,9 +190,9 @@ func (s *Service) startServices() { s.Shutdown <- true }() } else { - logger.Debug(logSender, "", "HTTP server not started, disabled in config file") + logger.Info(logSender, "", "HTTP server not started, disabled in config file") if s.PortableMode != 1 { - logger.DebugToConsole("HTTP server not started, disabled in config file") + logger.InfoToConsole("HTTP server not started, disabled in config file") } } if ftpdConf.ShouldBind() { @@ -205,7 +205,7 @@ func (s *Service) startServices() { s.Shutdown <- true }() } else { - logger.Debug(logSender, "", "FTP server not started, disabled in config file") + logger.Info(logSender, "", "FTP server not started, disabled in config file") } if webDavDConf.ShouldBind() { go func() { @@ -217,7 +217,7 @@ func (s *Service) startServices() { s.Shutdown <- true }() } else { - logger.Debug(logSender, "", "WebDAV server not started, disabled in config file") + logger.Info(logSender, "", "WebDAV server not started, disabled in config file") } if telemetryConf.ShouldBind() { go func() { @@ -229,9 +229,9 @@ func (s *Service) startServices() { s.Shutdown <- true }() } else { - logger.Debug(logSender, "", "telemetry server not started, disabled in config file") + logger.Info(logSender, "", "telemetry server not started, disabled in config file") if s.PortableMode != 1 { - logger.DebugToConsole("telemetry server not started, disabled in config file") + logger.InfoToConsole("telemetry server not started, disabled in config file") } } } diff --git a/telemetry/telemetry.go b/telemetry/telemetry.go index 9fc45e7a..6920c5ee 100644 --- a/telemetry/telemetry.go +++ b/telemetry/telemetry.go @@ -79,7 +79,7 @@ func (c Conf) ShouldBind() bool { // Initialize configures and starts the telemetry server. func (c Conf) Initialize(configDir string) error { var err error - logger.Debug(logSender, "", "initializing telemetry server with config %+v", c) + logger.Info(logSender, "", "initializing telemetry server with config %+v", c) authUserFile := getConfigPath(c.AuthUserFile, configDir) httpAuth, err = common.NewBasicAuthProvider(authUserFile) if err != nil { diff --git a/webdavd/webdavd.go b/webdavd/webdavd.go index 06af903e..3921c886 100644 --- a/webdavd/webdavd.go +++ b/webdavd/webdavd.go @@ -158,7 +158,7 @@ func (c *Configuration) ShouldBind() bool { // Initialize configures and starts the WebDAV server func (c *Configuration) Initialize(configDir string) error { - logger.Debug(logSender, "", "initializing WebDAV server with config %+v", *c) + logger.Info(logSender, "", "initializing WebDAV server with config %+v", *c) mimeTypeCache = mimeCache{ maxSize: c.Cache.MimeTypes.MaxSize, mimeTypes: make(map[string]string),