Skip to content

Commit

Permalink
Some test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
iancmcc committed Aug 18, 2016
1 parent 21ac1a3 commit 2eb5237
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
5 changes: 3 additions & 2 deletions logger.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import (
"errors"
"fmt"
"io"
"os"
"strings"
"sync"

Expand Down Expand Up @@ -168,6 +167,7 @@ func (l *Logger) GetEffectiveLevel() logrus.Level {
// root of the tree for purposes of configuring loggers.
func (l *Logger) ApplyConfig(config LogriConfig) error {
root := l.GetRoot()
origoutputs, origlocals := root.outputs, root.localOutputs
root.outputs = []io.Writer{}
root.localOutputs = []io.Writer{}
root.resetChildren()
Expand All @@ -191,7 +191,8 @@ func (l *Logger) ApplyConfig(config LogriConfig) error {
}
}
if len(root.outputs) == 0 && len(root.localOutputs) == 0 {
root.outputs = append(root.outputs, os.Stderr)
root.outputs = origoutputs
root.localOutputs = origlocals
}
root.propagate()
root.applyTmpState()
Expand Down
2 changes: 0 additions & 2 deletions logri_test.go
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
package logri_test

import (
"io/ioutil"
"reflect"
"testing"

Expand All @@ -27,7 +26,6 @@ var (
func (s *LogriSuite) SetUpTest(c *C) {
logger, hook := test.NewNullLogger()
s.logger = NewLoggerFromLogrus(logger)
s.logger.SetOutput(ioutil.Discard)
s.hook = hook
}

Expand Down

0 comments on commit 2eb5237

Please sign in to comment.