Skip to content

Commit

Permalink
Using fclairamb/go-log (#249)
Browse files Browse the repository at this point in the history
This makes using a common logging framework between all libraries much easier
  • Loading branch information
fclairamb authored Jul 27, 2021
1 parent a2f1f74 commit 61f871a
Show file tree
Hide file tree
Showing 10 changed files with 205 additions and 307 deletions.
2 changes: 1 addition & 1 deletion client_handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"sync"
"time"

"github.com/fclairamb/ftpserverlib/log"
log "github.com/fclairamb/go-log"
)

// HASHAlgo is the enumerable that represents the supported HASH algorithms
Expand Down
3 changes: 1 addition & 2 deletions driver_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,9 @@ import (
"testing"
"time"

"github.com/fclairamb/go-log/gokit"
gklog "github.com/go-kit/kit/log"
"github.com/spf13/afero"

"github.com/fclairamb/ftpserverlib/log/gokit"
)

type tlsVerificationReply int
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@ module github.com/fclairamb/ftpserverlib
go 1.16

require (
github.com/go-kit/kit v0.10.0
github.com/fclairamb/go-log v0.0.0-20210725225107-80efc81cb386
github.com/go-kit/kit v0.11.0
github.com/secsy/goftp v0.0.0-20200609142545-aa2de14babf4
github.com/spf13/afero v1.6.0
github.com/stretchr/testify v1.7.0
golang.org/x/text v0.3.4 // indirect
)

replace github.com/secsy/goftp => github.com/drakkan/goftp v0.0.0-20201220151643-27b7174e8caf
358 changes: 195 additions & 163 deletions go.sum

Large diffs are not rendered by default.

71 changes: 0 additions & 71 deletions log/gokit/go-kit.go

This file was deleted.

19 changes: 0 additions & 19 deletions log/gokit/log_test.go

This file was deleted.

44 changes: 0 additions & 44 deletions log/log.go

This file was deleted.

5 changes: 3 additions & 2 deletions server.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@ import (
"net"
"time"

"github.com/fclairamb/ftpserverlib/log"
log "github.com/fclairamb/go-log"
lognoop "github.com/fclairamb/go-log/noop"
)

var (
Expand Down Expand Up @@ -236,7 +237,7 @@ func (server *FtpServer) ListenAndServe() error {
func NewFtpServer(driver MainDriver) *FtpServer {
return &FtpServer{
driver: driver,
Logger: log.Nothing(),
Logger: lognoop.NewNoOpLogger(),
}
}

Expand Down
4 changes: 2 additions & 2 deletions server_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (

"github.com/stretchr/testify/require"

"github.com/fclairamb/ftpserverlib/log"
lognoop "github.com/fclairamb/go-log/noop"
)

func TestMain(m *testing.M) {
Expand Down Expand Up @@ -87,7 +87,7 @@ func TestListenerAcceptErrors(t *testing.T) {

server := FtpServer{
listener: newFakeListener(errNetFake),
Logger: log.Nothing(),
Logger: lognoop.NewNoOpLogger(),
}
err := server.Serve()
require.EqualError(t, err, errListenerAccept.Error())
Expand Down
2 changes: 1 addition & 1 deletion transfer_pasv.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"strings"
"time"

"github.com/fclairamb/ftpserverlib/log"
log "github.com/fclairamb/go-log"
)

// Active/Passive transfer connection handler
Expand Down

0 comments on commit 61f871a

Please sign in to comment.