diff --git a/cmd/legacy_main.go b/cmd/legacy_main.go index d01e2652c4..6bcec53b0d 100644 --- a/cmd/legacy_main.go +++ b/cmd/legacy_main.go @@ -297,7 +297,7 @@ func runCLIApp(c *cli.Context) (err error) { // if these are already being logged into a log-file, otherwise // there will be duplicate logs for these in both places (stdout and log-file). if newConfig.Foreground || newConfig.Logging.FilePath == "" { - logger.SLogger().Info("GCSFuse config", "config", newConfig) + logger.Info("GCSFuse config", "config", newConfig) } // The following will not warn if the user explicitly passed the default value for StatCacheCapacity. diff --git a/internal/logger/logger.go b/internal/logger/logger.go index c9d4dd73ff..46027e7939 100644 --- a/internal/logger/logger.go +++ b/internal/logger/logger.go @@ -42,14 +42,6 @@ var ( defaultLogger *slog.Logger ) -// SLogger exports the slog logger. -// This allows one to use the full breadth of features provided by slog. -// -// TODO: export defaultLogger instead of using this function. -func SLogger() *slog.Logger { - return defaultLogger -} - // InitLogFile initializes the logger factory to create loggers that print to // a log file. // In case of empty file, it starts writing the log to syslog file, which @@ -150,8 +142,8 @@ func Infof(format string, v ...interface{}) { } // Info prints the message with info severity. -func Info(v ...interface{}) { - defaultLogger.Info(fmt.Sprint(v...)) +func Info(message string, args ...any) { + defaultLogger.Info(message, args...) } // Warnf prints the message with WARNING severity in the specified format.