Skip to content

Commit

Permalink
Removed DiscardLogger. Just use DefaultLogger(Quiet:true) instead
Browse files Browse the repository at this point in the history
  • Loading branch information
deluan committed Oct 2, 2019
1 parent 6a131a0 commit 8545db6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 15 deletions.
4 changes: 2 additions & 2 deletions client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ func TestClient(t *testing.T) {
In: make(chan *protocol.Instruction, 100),
State: SessionActive,
done: make(chan bool),
logger: &DiscardLogger{},
logger: &DefaultLogger{Quiet: true},
tunnel: t,
protocol: "vnc",
}
c, _ := NewClient(s, &DiscardLogger{})
c, _ := NewClient(s, &DefaultLogger{Quiet: true})

Convey("It exposes the session state", func() {
s.State = SessionHandshake
Expand Down
13 changes: 0 additions & 13 deletions log.go
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,3 @@ func (l *DefaultLogger) Errorf(format string, args ...interface{}) {
log.Printf("ERRO: "+format, args...)
}
}

// Logger that discards all messages
type DiscardLogger struct{}

func (d *DiscardLogger) Tracef(format string, args ...interface{}) {}

func (d *DiscardLogger) Debugf(format string, args ...interface{}) {}

func (d *DiscardLogger) Infof(format string, args ...interface{}) {}

func (d *DiscardLogger) Warnf(format string, args ...interface{}) {}

func (d *DiscardLogger) Errorf(format string, args ...interface{}) {}

0 comments on commit 8545db6

Please sign in to comment.