Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

switch to NanoLIB log #59

Merged
merged 2 commits into from
Jun 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions cmd/nanocmd/api.go
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
package main

import (
"github.com/alexedwards/flow"
enginehttp "github.com/micromdm/nanocmd/engine/http"
"github.com/micromdm/nanocmd/log"
cmdplanhttp "github.com/micromdm/nanocmd/subsystem/cmdplan/http"
fvenablehttp "github.com/micromdm/nanocmd/subsystem/filevault/http"
invhttp "github.com/micromdm/nanocmd/subsystem/inventory/http"
profhttp "github.com/micromdm/nanocmd/subsystem/profile/http"

"github.com/alexedwards/flow"
"github.com/micromdm/nanolib/log"
)

type engineLike interface {
Expand Down
4 changes: 2 additions & 2 deletions cmd/nanocmd/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ import (

"github.com/micromdm/nanocmd/engine"
httpcwe "github.com/micromdm/nanocmd/http"
"github.com/micromdm/nanocmd/log/logkeys"
"github.com/micromdm/nanocmd/log/stdlogfmt"
"github.com/micromdm/nanocmd/logkeys"
"github.com/micromdm/nanocmd/mdm/foss"

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

// overridden by -ldflags -X
Expand Down
3 changes: 2 additions & 1 deletion cmd/nanocmd/workflows.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,15 @@ package main
import (
"fmt"

"github.com/micromdm/nanocmd/log"
"github.com/micromdm/nanocmd/workflow"
"github.com/micromdm/nanocmd/workflow/cmdplan"
"github.com/micromdm/nanocmd/workflow/fvenable"
"github.com/micromdm/nanocmd/workflow/fvrotate"
"github.com/micromdm/nanocmd/workflow/inventory"
"github.com/micromdm/nanocmd/workflow/lock"
"github.com/micromdm/nanocmd/workflow/profile"

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

type registerer interface {
Expand Down
7 changes: 4 additions & 3 deletions engine/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,12 +10,13 @@ import (
"time"

"github.com/micromdm/nanocmd/engine/storage"
"github.com/micromdm/nanocmd/log"
"github.com/micromdm/nanocmd/log/ctxlog"
"github.com/micromdm/nanocmd/log/logkeys"
"github.com/micromdm/nanocmd/logkeys"
"github.com/micromdm/nanocmd/mdm"
"github.com/micromdm/nanocmd/utils/uuid"
"github.com/micromdm/nanocmd/workflow"

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

var (
Expand Down
9 changes: 5 additions & 4 deletions engine/http/engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@ import (
"errors"
"net/http"

"github.com/alexedwards/flow"
"github.com/micromdm/nanocmd/http/api"
"github.com/micromdm/nanocmd/log"
"github.com/micromdm/nanocmd/log/ctxlog"
"github.com/micromdm/nanocmd/log/logkeys"
"github.com/micromdm/nanocmd/logkeys"
"github.com/micromdm/nanocmd/workflow"

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

var (
Expand Down
9 changes: 5 additions & 4 deletions engine/http/event.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,13 @@ import (
"errors"
"net/http"

"github.com/alexedwards/flow"
"github.com/micromdm/nanocmd/engine/storage"
"github.com/micromdm/nanocmd/http/api"
"github.com/micromdm/nanocmd/log"
"github.com/micromdm/nanocmd/log/ctxlog"
"github.com/micromdm/nanocmd/log/logkeys"
"github.com/micromdm/nanocmd/logkeys"

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

var (
Expand Down
5 changes: 3 additions & 2 deletions engine/worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,10 @@ import (
"time"

"github.com/micromdm/nanocmd/engine/storage"
"github.com/micromdm/nanocmd/log"
"github.com/micromdm/nanocmd/log/logkeys"
"github.com/micromdm/nanocmd/logkeys"
"github.com/micromdm/nanocmd/workflow"

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

const DefaultDuration = time.Minute * 5
Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ require (
github.com/google/uuid v1.6.0
github.com/groob/plist v0.0.0-20220217120414-63fa881b19a5
github.com/jessepeterson/mdmcommands v0.0.0-20230517161100-c5ca4128e1e3
github.com/micromdm/nanolib v0.1.1
github.com/peterbourgon/diskv/v3 v3.0.1
github.com/smallstep/pkcs7 v0.0.0-20231107075624-be1870d87d13
)
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@ github.com/groob/plist v0.0.0-20220217120414-63fa881b19a5 h1:saaSiB25B1wgaxrshQh
github.com/groob/plist v0.0.0-20220217120414-63fa881b19a5/go.mod h1:itkABA+w2cw7x5nYUS/pLRef6ludkZKOigbROmCTaFw=
github.com/jessepeterson/mdmcommands v0.0.0-20230517161100-c5ca4128e1e3 h1:J825aym3sjbzht2K6m4Bd8HPkvV0lbyM/G2ZjGHuDaU=
github.com/jessepeterson/mdmcommands v0.0.0-20230517161100-c5ca4128e1e3/go.mod h1:EHxwKfMUtf7wNjF19BQQ/XCOvh62vbOXTggS9guNVxY=
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 h1:x06SQA46+PKIUftmEujdwSEpIx8kR+M9eLYsUxeYveU=
github.com/peterbourgon/diskv/v3 v3.0.1/go.mod h1:kJ5Ny7vLdARGU3WUuy6uzO6T0nb/2gWcT1JiBvRmb5o=
github.com/smallstep/pkcs7 v0.0.0-20231107075624-be1870d87d13 h1:qRxEt9ESQhAg1kjmgJ8oyyzlc9zkAjOooe7bcKjKORQ=
Expand Down
4 changes: 2 additions & 2 deletions http/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ import (
"net"
"net/http"

"github.com/micromdm/nanocmd/log"
"github.com/micromdm/nanocmd/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
File renamed without changes.
7 changes: 4 additions & 3 deletions mdm/foss/foss.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,10 @@ import (
"net/url"
"strings"

"github.com/micromdm/nanocmd/log"
"github.com/micromdm/nanocmd/log/ctxlog"
"github.com/micromdm/nanocmd/log/logkeys"
"github.com/micromdm/nanocmd/logkeys"

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

var ErrNoIDsInIDChunk = errors.New("no ids in id chunk")
Expand Down
7 changes: 4 additions & 3 deletions mdm/foss/webhook.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,10 @@ import (
"net/http"
"time"

"github.com/micromdm/nanocmd/log"
"github.com/micromdm/nanocmd/log/ctxlog"
"github.com/micromdm/nanocmd/log/logkeys"
"github.com/micromdm/nanocmd/logkeys"

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

type Event struct {
Expand Down
3 changes: 2 additions & 1 deletion mdm/foss/webhook_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,10 @@ import (
"testing"
"time"

"github.com/micromdm/nanocmd/log"
"github.com/micromdm/nanocmd/mdm"
"github.com/micromdm/nanocmd/workflow"

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

type event struct {
Expand Down
9 changes: 5 additions & 4 deletions subsystem/cmdplan/http/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,13 @@ import (
"errors"
"net/http"

"github.com/alexedwards/flow"
"github.com/micromdm/nanocmd/http/api"
"github.com/micromdm/nanocmd/log"
"github.com/micromdm/nanocmd/log/ctxlog"
"github.com/micromdm/nanocmd/log/logkeys"
"github.com/micromdm/nanocmd/logkeys"
"github.com/micromdm/nanocmd/subsystem/cmdplan/storage"

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

var (
Expand Down
7 changes: 4 additions & 3 deletions subsystem/inventory/http/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@ import (
"net/http"

"github.com/micromdm/nanocmd/http/api"
"github.com/micromdm/nanocmd/log"
"github.com/micromdm/nanocmd/log/ctxlog"
"github.com/micromdm/nanocmd/log/logkeys"
"github.com/micromdm/nanocmd/logkeys"
"github.com/micromdm/nanocmd/subsystem/inventory/storage"

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

var (
Expand Down
9 changes: 5 additions & 4 deletions subsystem/profile/http/http.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@ import (
"io"
"net/http"

"github.com/alexedwards/flow"
"github.com/micromdm/nanocmd/http/api"
"github.com/micromdm/nanocmd/log"
"github.com/micromdm/nanocmd/log/ctxlog"
"github.com/micromdm/nanocmd/log/logkeys"
"github.com/micromdm/nanocmd/logkeys"
"github.com/micromdm/nanocmd/subsystem/profile/storage"
"github.com/micromdm/nanocmd/utils/mobileconfig"

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

// GetProfilesHandler returns an HTTP handler that returns profile metadata for all profile names.
Expand Down
9 changes: 5 additions & 4 deletions workflow/cmdplan/workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,16 @@ import (
"os"
"strings"

"github.com/jessepeterson/mdmcommands"
"github.com/micromdm/nanocmd/log"
"github.com/micromdm/nanocmd/log/ctxlog"
"github.com/micromdm/nanocmd/log/logkeys"
"github.com/micromdm/nanocmd/logkeys"
"github.com/micromdm/nanocmd/mdm"
"github.com/micromdm/nanocmd/subsystem/cmdplan/storage"
profstorage "github.com/micromdm/nanocmd/subsystem/profile/storage"
"github.com/micromdm/nanocmd/utils/uuid"
"github.com/micromdm/nanocmd/workflow"

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

const WorkflowName = "io.micromdm.wf.cmdplan.v1"
Expand Down
9 changes: 5 additions & 4 deletions workflow/fvenable/workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,15 @@ import (
"fmt"
"time"

"github.com/jessepeterson/mdmcommands"
"github.com/micromdm/nanocmd/log"
"github.com/micromdm/nanocmd/log/ctxlog"
"github.com/micromdm/nanocmd/log/logkeys"
"github.com/micromdm/nanocmd/logkeys"
fvstorage "github.com/micromdm/nanocmd/subsystem/filevault/storage"
profstorage "github.com/micromdm/nanocmd/subsystem/profile/storage"
"github.com/micromdm/nanocmd/utils/uuid"
"github.com/micromdm/nanocmd/workflow"

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

const WorkflowName = "io.micromdm.wf.fvenable.v1"
Expand Down
9 changes: 5 additions & 4 deletions workflow/fvrotate/workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,14 @@ import (
"errors"
"fmt"

"github.com/jessepeterson/mdmcommands"
"github.com/micromdm/nanocmd/log"
"github.com/micromdm/nanocmd/log/ctxlog"
"github.com/micromdm/nanocmd/log/logkeys"
"github.com/micromdm/nanocmd/logkeys"
"github.com/micromdm/nanocmd/subsystem/filevault/storage"
"github.com/micromdm/nanocmd/utils/uuid"
"github.com/micromdm/nanocmd/workflow"

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

const WorkflowName = "io.micromdm.wf.fvrotate.v1"
Expand Down
9 changes: 5 additions & 4 deletions workflow/lock/workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@ import (
"math/rand"
"time"

"github.com/jessepeterson/mdmcommands"
"github.com/micromdm/nanocmd/log"
"github.com/micromdm/nanocmd/log/ctxlog"
"github.com/micromdm/nanocmd/log/logkeys"
"github.com/micromdm/nanocmd/logkeys"
"github.com/micromdm/nanocmd/subsystem/inventory/storage"
"github.com/micromdm/nanocmd/utils/uuid"
"github.com/micromdm/nanocmd/workflow"

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

const WorkflowName = "io.micromdm.wf.lock.v1"
Expand Down
9 changes: 5 additions & 4 deletions workflow/profile/workflow.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,14 @@ import (
"fmt"
"strings"

"github.com/jessepeterson/mdmcommands"
"github.com/micromdm/nanocmd/log"
"github.com/micromdm/nanocmd/log/ctxlog"
"github.com/micromdm/nanocmd/log/logkeys"
"github.com/micromdm/nanocmd/logkeys"
"github.com/micromdm/nanocmd/subsystem/profile/storage"
"github.com/micromdm/nanocmd/utils/uuid"
"github.com/micromdm/nanocmd/workflow"

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

const WorkflowName = "io.micromdm.wf.profile.v1"
Expand Down