Skip to content

Commit

Permalink
Feedback cleanup.
Browse files Browse the repository at this point in the history
  • Loading branch information
severb committed Jan 28, 2016
1 parent 34cf1fc commit 6627a4d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion logging/facility.go
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ func (f *Facility) SetLevels(levels map[string]Level) error {
// SetLevel sets the minimum severity level for a named logger. All messages
// produced by a named logger with a severity lower than the one set here are
// silenced.
// In most of logger implementations, both Fatal and Panic stop the execution.
// In most logger implementations, both Fatal and Panic stop the execution.
// This means that those levels only produce a single, and often important,
// message. Because of that, it's an error to pass a level above Fatal to this
// method.
Expand Down
6 changes: 4 additions & 2 deletions logging/level.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ const (
// Debug log level
Debug

maxLevel = int(^uint8(0))
// maxLevel is the maximum valid log level.
// This is used internally for boundary check.
maxLevel = int(255)
)

// String converts a log level to its string representation.
Expand Down Expand Up @@ -84,7 +86,7 @@ func Parse(lvl string) (Level, error) {

level, err := strconv.Atoi(lvl)
if level > maxLevel {
err = fmt.Errorf("Invalid level value: %s", lvl)
err = fmt.Errorf("invalid level value: %s", lvl)
}
return Level(level), err
}

0 comments on commit 6627a4d

Please sign in to comment.