Skip to content

Commit

Permalink
switch to NanoLIB log (#132)
Browse files Browse the repository at this point in the history
  • Loading branch information
jessepeterson authored Jun 13, 2024
1 parent 88119c5 commit 0fa2e73
Show file tree
Hide file tree
Showing 26 changed files with 52 additions and 259 deletions.
2 changes: 1 addition & 1 deletion cli/cli.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"fmt"
"strings"

"github.com/micromdm/nanomdm/log"
"github.com/micromdm/nanomdm/storage"
"github.com/micromdm/nanomdm/storage/allmulti"
"github.com/micromdm/nanomdm/storage/file"
Expand All @@ -15,6 +14,7 @@ import (

_ "github.com/go-sql-driver/mysql"
_ "github.com/lib/pq"
"github.com/micromdm/nanolib/log"
)

type StringAccumulator []string
Expand Down
3 changes: 2 additions & 1 deletion cmd/nano2nano/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,9 @@ import (
"net/http"

"github.com/micromdm/nanomdm/cli"
"github.com/micromdm/nanomdm/log/stdlogfmt"
"github.com/micromdm/nanomdm/mdm"

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

// overridden by -ldflags -X
Expand Down
3 changes: 2 additions & 1 deletion cmd/nanomdm/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ import (
httpapi "github.com/micromdm/nanomdm/http/api"
"github.com/micromdm/nanomdm/http/authproxy"
httpmdm "github.com/micromdm/nanomdm/http/mdm"
"github.com/micromdm/nanomdm/log/stdlogfmt"
"github.com/micromdm/nanomdm/push/nanopush"
pushsvc "github.com/micromdm/nanomdm/push/service"
"github.com/micromdm/nanomdm/service"
Expand All @@ -26,6 +25,8 @@ import (
"github.com/micromdm/nanomdm/service/microwebhook"
"github.com/micromdm/nanomdm/service/multi"
"github.com/micromdm/nanomdm/service/nanomdm"

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

// overridden by -ldflags -X
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ require (
github.com/go-sql-driver/mysql v1.8.1
github.com/groob/plist v0.0.0-20220217120414-63fa881b19a5
github.com/lib/pq v1.10.9
github.com/micromdm/nanolib v0.1.1
github.com/smallstep/pkcs7 v0.0.0-20231107075624-be1870d87d13
golang.org/x/net v0.25.0
)
Expand Down
4 changes: 4 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,15 @@ github.com/RobotsAndPencils/buford v0.14.0/go.mod h1:F5FvdB/nkMby8Pge6HFpPHgLOeU
github.com/aai/gocrypto v0.0.0-20160205191751-93df0c47f8b8/go.mod h1:nE/FnVUmtbP0EbgMVCUtDrm1+86H47QfJIdcmZb+J1s=
github.com/go-sql-driver/mysql v1.8.1 h1:LedoTUt/eveggdHS9qUFC1EFSa8bU2+1pZjSRpvNJ1Y=
github.com/go-sql-driver/mysql v1.8.1/go.mod h1:wEBSXgmK//2ZFJyE+qWnIsVGmvmEKlqwuVSjsCm7DZg=
github.com/google/btree v1.0.0/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
github.com/gorilla/mux v1.7.3/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
github.com/groob/plist v0.0.0-20220217120414-63fa881b19a5 h1:saaSiB25B1wgaxrshQhurfPKUGJ4It3OxNJUy0rdOjU=
github.com/groob/plist v0.0.0-20220217120414-63fa881b19a5/go.mod h1:itkABA+w2cw7x5nYUS/pLRef6ludkZKOigbROmCTaFw=
github.com/lib/pq v1.10.9 h1:YXG7RB+JIjhP29X+OtkiDnYaXQwpS4JEWq7dtCCRUEw=
github.com/lib/pq v1.10.9/go.mod h1:AlVN5x4E4T544tWzH6hKfbfQvm3HdbOxrmggDNAPY9o=
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=
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
Expand Down
5 changes: 3 additions & 2 deletions http/api/api.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,12 @@ import (

"github.com/micromdm/nanomdm/cryptoutil"
mdmhttp "github.com/micromdm/nanomdm/http"
"github.com/micromdm/nanomdm/log"
"github.com/micromdm/nanomdm/log/ctxlog"
"github.com/micromdm/nanomdm/mdm"
"github.com/micromdm/nanomdm/push"
"github.com/micromdm/nanomdm/storage"

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

// enrolledAPIResult is a per-enrollment API result.
Expand Down
4 changes: 2 additions & 2 deletions http/authproxy/authproxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import (
"net/http/httputil"
"net/url"

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

// HeaderFunc takes an HTTP request and returns a string value.
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/nanomdm/log"
"github.com/micromdm/nanomdm/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
5 changes: 3 additions & 2 deletions http/mdm/mdm.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ import (
"strings"

mdmhttp "github.com/micromdm/nanomdm/http"
"github.com/micromdm/nanomdm/log"
"github.com/micromdm/nanomdm/log/ctxlog"
"github.com/micromdm/nanomdm/mdm"
"github.com/micromdm/nanomdm/service"

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

func mdmReqFromHTTPReq(r *http.Request) *mdm.Request {
Expand Down
5 changes: 3 additions & 2 deletions http/mdm/mdm_cert.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ import (

"github.com/micromdm/nanomdm/cryptoutil"
mdmhttp "github.com/micromdm/nanomdm/http"
"github.com/micromdm/nanomdm/log"
"github.com/micromdm/nanomdm/log/ctxlog"
"github.com/micromdm/nanomdm/storage"

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

type contextKeyCert struct{}
Expand Down
2 changes: 1 addition & 1 deletion http/mdm/mdm_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import (
"net/http/httptest"
"testing"

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

const (
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.

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

This file was deleted.

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

"github.com/micromdm/nanomdm/log"
"github.com/micromdm/nanomdm/log/ctxlog"
"github.com/micromdm/nanomdm/mdm"
"github.com/micromdm/nanomdm/push"
"github.com/micromdm/nanomdm/storage"

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

type provider struct {
Expand Down
Loading

0 comments on commit 0fa2e73

Please sign in to comment.