Skip to content

Commit f8af118

Browse files
authored
fix(core): make warning the default logger level (#685)
1 parent 94cb5b9 commit f8af118

File tree

4 files changed

+4
-4
lines changed

4 files changed

+4
-4
lines changed

internal/core/build_info.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ func (b *BuildInfo) checkVersion() {
6464
}
6565

6666
if b.Version.LessThan(latestVersion) {
67-
logger.Infof("a new version of scw is available (%s), beware that you are currently running %v", latestVersion, b.Version)
67+
logger.Warningf("a new version of scw is available (%s), beware that you are currently running %v", latestVersion, b.Version)
6868
} else {
6969
logger.Debugf("version is up to date (%s)", b.Version)
7070
}

internal/core/cobra_utils.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ func cobraPreRunInitMeta(ctx context.Context, cmd *Command) func(cmd *cobra.Comm
115115
var err error
116116
meta := extractMeta(ctx)
117117

118-
logLevel := logger.LogLevelInfo
118+
logLevel := logger.LogLevelWarning
119119
if meta.DebugModeFlag {
120120
logLevel = logger.LogLevelDebug // enable debug mode
121121
}
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
INFO: 2019/12/09 16:04:07 a new version of scw is available (2.0.0-alpha1), beware that you are currently running 1.20.0
1+
WARNING: 2019/12/09 16:04:07 a new version of scw is available (2.0.0-alpha1), beware that you are currently running 1.20.0

internal/core/validate.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ func validateArgValues(cmd *Command, cmdArgs interface{}) error {
3838
fieldName = strings.ReplaceAll(fieldName, "."+mapSchema, "")
3939
fieldValue, fieldExists := getValueForFieldByName(cmdArgs, fieldName)
4040
if !fieldExists {
41-
logger.Debugf("could not validate arg value for '%v': invalid fieldName: %v", argSpec.Name, fieldName)
41+
logger.Infof("could not validate arg value for '%v': invalid fieldName: %v", argSpec.Name, fieldName)
4242
continue
4343
}
4444
validateFunc := DefaultArgSpecValidateFunc()

0 commit comments

Comments
 (0)