Skip to content

Commit

Permalink
Merge pull request #37 from hashicorp/svh/f-level-writer
Browse files Browse the repository at this point in the history
Rename `NewLevelWriter` to `NewLeveledWriter`
  • Loading branch information
Sander van Harmelen authored Mar 5, 2019
2 parents 73fd499 + fcba393 commit 6907afb
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
6 changes: 3 additions & 3 deletions logger_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,7 @@ func TestLogger_leveledWriter(t *testing.T) {

logger := New(&LoggerOptions{
Name: "test",
Output: NewLevelWriter(&stdout, map[Level]io.Writer{Error: &stderr}),
Output: NewLeveledWriter(&stdout, map[Level]io.Writer{Error: &stderr}),
})

logger.Error("this is an error", "who", "programmer", "why", "testing")
Expand All @@ -361,7 +361,7 @@ func TestLogger_leveledWriter(t *testing.T) {

logger := New(&LoggerOptions{
Name: "test",
Output: NewLevelWriter(&stdout, map[Level]io.Writer{Error: &stderr}),
Output: NewLeveledWriter(&stdout, map[Level]io.Writer{Error: &stderr}),
})

logger.Info("this is test", "who", "programmer", "why", "testing")
Expand All @@ -379,7 +379,7 @@ func TestLogger_leveledWriter(t *testing.T) {

logger := New(&LoggerOptions{
Name: "test",
Output: NewLevelWriter(&stdout, map[Level]io.Writer{Error: &stderr}),
Output: NewLeveledWriter(&stdout, map[Level]io.Writer{Error: &stderr}),
})

logger.Info("this is test", "who", "programmer", "why", "testing")
Expand Down
4 changes: 2 additions & 2 deletions writer.go
Original file line number Diff line number Diff line change
Expand Up @@ -48,11 +48,11 @@ type LeveledWriter struct {
overrides map[Level]io.Writer
}

// NewLevelWriter returns an initialized LeveledWriter.
// NewLeveledWriter returns an initialized LeveledWriter.
//
// standard will be used as the default writer for all log levels,
// except for log levels that are defined in the overrides map.
func NewLevelWriter(standard io.Writer, overrides map[Level]io.Writer) *LeveledWriter {
func NewLeveledWriter(standard io.Writer, overrides map[Level]io.Writer) *LeveledWriter {
return &LeveledWriter{
standard: standard,
overrides: overrides,
Expand Down

0 comments on commit 6907afb

Please sign in to comment.