Skip to content

Commit

Permalink
switch to nanolib log (#67)
Browse files Browse the repository at this point in the history
  • Loading branch information
jessepeterson committed Jun 13, 2024
1 parent 4a137c4 commit 11b0749
Show file tree
Hide file tree
Showing 16 changed files with 40 additions and 190 deletions.
8 changes: 6 additions & 2 deletions cmd/depserver/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ import (
"github.com/micromdm/nanodep/client"
dephttp "github.com/micromdm/nanodep/http"
"github.com/micromdm/nanodep/http/api"
"github.com/micromdm/nanodep/log/stdlogfmt"
"github.com/micromdm/nanodep/proxy"

"github.com/micromdm/nanolib/log/stdlogfmt"
)

// overridden by -ldflags -X
Expand Down Expand Up @@ -53,7 +54,10 @@ func main() {
os.Exit(1)
}

logger := stdlogfmt.New(stdlog.Default(), *flDebug)
logger := stdlogfmt.New(
stdlogfmt.WithLogger(stdlog.Default()),
stdlogfmt.WithDebugFlag(*flDebug),
)

storage, err := cli.Storage(*flStorage, *flDSN)
if err != nil {
Expand Down
8 changes: 6 additions & 2 deletions cmd/depsyncer/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,9 @@ import (

"github.com/micromdm/nanodep/cli"
"github.com/micromdm/nanodep/godep"
"github.com/micromdm/nanodep/log/stdlogfmt"
depsync "github.com/micromdm/nanodep/sync"

"github.com/micromdm/nanolib/log/stdlogfmt"
)

// overridden by -ldflags -X
Expand Down Expand Up @@ -52,7 +53,10 @@ func main() {
os.Exit(1)
}

logger := stdlogfmt.New(stdlog.Default(), *flDebug)
logger := stdlogfmt.New(
stdlogfmt.WithLogger(stdlog.Default()),
stdlogfmt.WithDebugFlag(*flDebug),
)

storage, err := cli.Storage(*flStorage, *flDSN)
if err != nil {
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ go 1.17
require (
github.com/go-sql-driver/mysql v1.8.1
github.com/gomodule/oauth1 v0.2.0
github.com/micromdm/nanolib v0.1.1
github.com/smallstep/pkcs7 v0.0.0-20231107075624-be1870d87d13
)

Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,9 @@ github.com/go-sql-driver/mysql v1.8.1 h1:LedoTUt/eveggdHS9qUFC1EFSa8bU2+1pZjSRpv
github.com/go-sql-driver/mysql v1.8.1/go.mod h1:wEBSXgmK//2ZFJyE+qWnIsVGmvmEKlqwuVSjsCm7DZg=
github.com/gomodule/oauth1 v0.2.0 h1:/nNHAD99yipOEspQFbAnNmwGTZ1UNXiD/+JLxwx79fo=
github.com/gomodule/oauth1 v0.2.0/go.mod h1:4r/a8/3RkhMBxJQWL5qzbOEcaQmNPIkNoI7P8sXeI08=
github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
github.com/micromdm/nanolib v0.1.1 h1:nNwY2xLBTHSpwEJsW5xGjkW9MdskAbeo/e6+ZYwr2mE=
github.com/micromdm/nanolib v0.1.1/go.mod h1:FwBKCvvphgYvbdUZ+qw5kay7NHJcg6zPi8W7kXNajmE=
github.com/peterbourgon/diskv/v3 v3.0.1/go.mod h1:kJ5Ny7vLdARGU3WUuy6uzO6T0nb/2gWcT1JiBvRmb5o=
github.com/smallstep/pkcs7 v0.0.0-20231107075624-be1870d87d13 h1:qRxEt9ESQhAg1kjmgJ8oyyzlc9zkAjOooe7bcKjKORQ=
github.com/smallstep/pkcs7 v0.0.0-20231107075624-be1870d87d13/go.mod h1:SoUAr/4M46rZ3WaLstHxGhLEgoYIDRqxQEXLOmOEB0Y=
5 changes: 3 additions & 2 deletions http/api/assigner.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ import (
"encoding/json"
"net/http"

"github.com/micromdm/nanodep/log"
"github.com/micromdm/nanodep/log/ctxlog"
"github.com/micromdm/nanodep/sync"

"github.com/micromdm/nanolib/log"
"github.com/micromdm/nanolib/log/ctxlog"
)

// RetrieveAssignerProfileHandler returns the assigner profile UUID for the
Expand Down
5 changes: 3 additions & 2 deletions http/api/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ import (
"net/http"

"github.com/micromdm/nanodep/client"
"github.com/micromdm/nanodep/log"
"github.com/micromdm/nanodep/log/ctxlog"

"github.com/micromdm/nanolib/log"
"github.com/micromdm/nanolib/log/ctxlog"
)

// RetrieveConfigHandler returns the DEP server config for the DEP
Expand Down
5 changes: 3 additions & 2 deletions http/api/tokenpki.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@ import (
"strconv"

"github.com/micromdm/nanodep/client"
"github.com/micromdm/nanodep/log"
"github.com/micromdm/nanodep/log/ctxlog"
"github.com/micromdm/nanodep/tokenpki"

"github.com/micromdm/nanolib/log"
"github.com/micromdm/nanolib/log/ctxlog"
)

type TokenPKIStagingRetriever interface {
Expand Down
5 changes: 3 additions & 2 deletions http/api/tokens.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ import (
"net/http"

"github.com/micromdm/nanodep/client"
"github.com/micromdm/nanodep/log"
"github.com/micromdm/nanodep/log/ctxlog"

"github.com/micromdm/nanolib/log"
"github.com/micromdm/nanolib/log/ctxlog"
)

var CKMismatch = errors.New("mismatched consumer key")
Expand Down
4 changes: 2 additions & 2 deletions http/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ import (
"net"
"net/http"

"github.com/micromdm/nanodep/log"
"github.com/micromdm/nanodep/log/ctxlog"
"github.com/micromdm/nanolib/log"
"github.com/micromdm/nanolib/log/ctxlog"
)

// ReadAllAndReplaceBody reads all of r.Body and replaces it with a new byte buffer.
Expand Down
72 changes: 0 additions & 72 deletions log/ctxlog/ctxlog.go

This file was deleted.

17 changes: 0 additions & 17 deletions log/logger.go

This file was deleted.

21 changes: 0 additions & 21 deletions log/nop.go

This file was deleted.

60 changes: 0 additions & 60 deletions log/stdlogfmt/stdlog.go

This file was deleted.

5 changes: 3 additions & 2 deletions proxy/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ import (
"sync"

"github.com/micromdm/nanodep/client"
"github.com/micromdm/nanodep/log"
"github.com/micromdm/nanodep/log/ctxlog"

"github.com/micromdm/nanolib/log"
"github.com/micromdm/nanolib/log/ctxlog"
)

// New creates new NanoDEP ReverseProxy. It dispatches requests using transport
Expand Down
5 changes: 3 additions & 2 deletions sync/assigner.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,9 @@ import (
"time"

"github.com/micromdm/nanodep/godep"
"github.com/micromdm/nanodep/log"
"github.com/micromdm/nanodep/log/ctxlog"

"github.com/micromdm/nanolib/log"
"github.com/micromdm/nanolib/log/ctxlog"
)

type AssignerProfileRetriever interface {
Expand Down
5 changes: 3 additions & 2 deletions sync/syncer.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,9 @@ import (
"time"

"github.com/micromdm/nanodep/godep"
"github.com/micromdm/nanodep/log"
"github.com/micromdm/nanodep/log/ctxlog"

"github.com/micromdm/nanolib/log"
"github.com/micromdm/nanolib/log/ctxlog"
)

// CursorStorage is where the device fetch and sync cursor can be stored and
Expand Down

0 comments on commit 11b0749

Please sign in to comment.