Skip to content

Commit

Permalink
refactor: Use latest bootstrap for logging client changes
Browse files Browse the repository at this point in the history
Remote and file logging have been removed

closes #2974

Signed-off-by: lenny <[email protected]>
  • Loading branch information
lenny committed Dec 29, 2020
1 parent 0334f8c commit 3303252
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 4 deletions.
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,9 @@ require (
github.com/BurntSushi/toml v0.3.1
github.com/OneOfOne/xxhash v1.2.8
github.com/dgrijalva/jwt-go v3.2.0+incompatible
github.com/edgexfoundry/go-mod-bootstrap v0.0.64
github.com/edgexfoundry/go-mod-bootstrap v0.0.65
github.com/edgexfoundry/go-mod-configuration v0.0.8
github.com/edgexfoundry/go-mod-core-contracts v0.1.131
github.com/edgexfoundry/go-mod-core-contracts v0.1.135
github.com/edgexfoundry/go-mod-messaging v0.1.28
github.com/edgexfoundry/go-mod-registry v0.1.27
github.com/edgexfoundry/go-mod-secrets v0.0.29
Expand Down
29 changes: 29 additions & 0 deletions internal/core/metadata/operators/device/notify_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,11 @@ func (lc mockNotifyLogger) SetLogLevel(_ string) error {
return nil
}

// LogLevel returns the current log level setting
func (lc mockNotifyLogger) LogLevel() string {
return ""
}

// Info simulates logging an entry at the INFO severity level
func (lc mockNotifyLogger) Info(_ string, _ ...interface{}) {
}
Expand All @@ -163,3 +168,27 @@ func (lc mockNotifyLogger) Trace(_ string, _ ...interface{}) {
// Warn simulates logging an entry at the WARN severity level
func (lc mockNotifyLogger) Warn(_ string, _ ...interface{}) {
}

// Infof simulates logging an formatted message at the INFO severity level
func (lc mockNotifyLogger) Infof(_ string, _ ...interface{}) {
}

// Debugf simulates logging an formatted message at the DEBUG severity level
func (lc mockNotifyLogger) Debugf(_ string, _ ...interface{}) {
}

// Errorf simulates logging an formatted message at the ERROR severity level
func (lc mockNotifyLogger) Errorf(msg string, _ ...interface{}) {
if !lc.expectError {
lc.t.Error(msg)
lc.t.Fail()
}
}

// Tracef simulates logging an formatted message at the TRACE severity level
func (lc mockNotifyLogger) Tracef(_ string, _ ...interface{}) {
}

// Warnf simulates logging an formatted message at the WARN severity level
func (lc mockNotifyLogger) Warnf(_ string, _ ...interface{}) {
}
6 changes: 4 additions & 2 deletions internal/security/config/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,13 @@ import (
"context"
"os"

"github.com/edgexfoundry/go-mod-core-contracts/clients/logger"

"github.com/edgexfoundry/edgex-go/internal"
"github.com/edgexfoundry/edgex-go/internal/security/config/command"
"github.com/edgexfoundry/edgex-go/internal/security/proxy/config"
"github.com/edgexfoundry/edgex-go/internal/security/proxy/container"
"github.com/edgexfoundry/go-mod-core-contracts/clients/logger"

"github.com/edgexfoundry/go-mod-core-contracts/models"

"github.com/edgexfoundry/go-mod-bootstrap/bootstrap"
Expand All @@ -36,7 +38,7 @@ func Main(ctx context.Context, cancel context.CancelFunc) int {
f := command.NewCommonFlags()
f.Parse(os.Args[1:])

lc := logger.NewClientStdOut(securitySecretsConfigServiceKey, false, models.ErrorLog)
lc := logger.NewClient(securitySecretsConfigServiceKey, models.ErrorLog)
configuration := &config.ConfigurationStruct{}
dic := di.NewContainer(di.ServiceConstructorMap{
container.ConfigurationName: func(get di.Get) interface{} {
Expand Down

0 comments on commit 3303252

Please sign in to comment.