Skip to content

Commit

Permalink
log: linter fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
rkhomenko committed Jun 10, 2024
1 parent 0b24d63 commit 876e360
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions log/log.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@ type LoggerOptions struct {
logFile string
}

// Type for setter functions that specify LoggerOptions parameters
// LoggerOption is type for setter functions that specify LoggerOptions parameters
type LoggerOption func(*LoggerOptions)

// Setter for LoggerOptions.logFile parameter
// LogFile is setter for LoggerOptions.logFile parameter
func LogFile(logFile string) LoggerOption {
return func(args *LoggerOptions) {
args.logFile = logFile
Expand Down Expand Up @@ -87,7 +87,7 @@ type Logger struct {
logFiles *LogFiles
}

// Вefault value that disables the use of the log file
// NoLogFile is default value that disables the use of the log file
const NoLogFile string = ""

// New creates new logger.
Expand Down Expand Up @@ -193,14 +193,14 @@ func LevelFromString(s string) LogLevel {
}
}

// Closes stdout and stderr if file pointers are not os.Stdout or os.Stderr
// Close closes stdout and stderr if file pointers are not os.Stdout or os.Stderr
func (files *LogFiles) Close() {
if files.stdout != os.Stdout {
files.stdout.Close()
}
}

// Сhecks the path to the file is correct
// IsValidLogFile checks the path to the file is correct
func IsValidLogFile(logFile string) error {
if logFile == NoLogFile {
return nil
Expand All @@ -215,7 +215,7 @@ func IsValidLogFile(logFile string) error {
return nil
}

// Creates and/or opens a file for logging if the path to the file was specified.
// GetLogFiles creates and/or opens a file for logging if the path to the file was specified.
// Otherwise uses os.Stdout and os.Stderr for logging
func GetLogFiles(logFile string) *LogFiles {
if logFile == NoLogFile {
Expand Down

0 comments on commit 876e360

Please sign in to comment.