Skip to content

Commit

Permalink
Incorporate review comments
Browse files Browse the repository at this point in the history
  • Loading branch information
kislaykishore committed Aug 9, 2024
1 parent 702b7f9 commit b933a1f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
2 changes: 1 addition & 1 deletion cmd/legacy_main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
12 changes: 2 additions & 10 deletions internal/logger/logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down

0 comments on commit b933a1f

Please sign in to comment.