Skip to content

Commit

Permalink
fix logging bug, fix go1.13 testing bug, bump version
Browse files Browse the repository at this point in the history
  • Loading branch information
edaniszewski committed Mar 30, 2020
1 parent af5817a commit e99a666
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 4 deletions.
1 change: 1 addition & 0 deletions sdk/config/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ func (conf *Plugin) Log() {
log.Infof(" Version: %d", conf.Version)
log.Infof(" Debug: %v", conf.Debug)
conf.ID.Log()
conf.Metrics.Log()
conf.Settings.Log()
conf.Network.Log()
conf.Health.Log()
Expand Down
9 changes: 6 additions & 3 deletions sdk/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,6 @@ func init() {
flag.BoolVar(&flagDebug, "debug", false, "enable debug logging")
flag.BoolVar(&flagVersion, "version", false, "print the plugin version information")
flag.BoolVar(&flagDryRun, "dry-run", false, "run only the setup actions to verify functionality and configuration")

flag.Parse()
handleRunOptions()
}

// PluginAction defines an action that can be run before or after the main
Expand Down Expand Up @@ -96,6 +93,12 @@ type Plugin struct {
// or invalid, this will fail. All other Plugin component initialization
// is deferred until Run is called.
func NewPlugin(options ...PluginOption) (*Plugin, error) {

// These used to be called in the init() fn. As of go1.13, there is an issue with
// parsing flags in init() when running tests. https://github.com/golang/go/issues/31859
flag.Parse()
handleRunOptions()

// Since this is essentially the entry point for the plugin and setup actions
// occur as part of plugin construction, we want to set the log level as early
// as possible. If the debug flag is set, set the level to debug.
Expand Down
2 changes: 1 addition & 1 deletion sdk/version.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ import (
)

// Version specifies the version of the Synse Plugin SDK.
const Version = "3.0.0-alpha.2"
const Version = "3.0.0-alpha.3"

// version is a global reference to the pluginVersion which specifies the
// version information for a Plugin. This is initialized on init and
Expand Down

0 comments on commit e99a666

Please sign in to comment.