@@ -98,7 +98,7 @@ func (c *migrateCommand) execute(_ *cobra.Command, _ []string) error {
98
98
return err
99
99
}
100
100
101
- c .cmd . Println ("Migrating v1 configuration file:" , srcPath )
101
+ c .log . Infof ("Migrating v1 configuration file: %s " , srcPath )
102
102
103
103
ext := filepath .Ext (srcPath )
104
104
if strings .TrimSpace (c .opts .format ) != "" {
@@ -120,7 +120,7 @@ func (c *migrateCommand) execute(_ *cobra.Command, _ []string) error {
120
120
return fmt .Errorf ("saving configuration file: %w" , err )
121
121
}
122
122
123
- c .cmd . Println ("Migration done:" , dstPath )
123
+ c .log . Infof ("Migration done: %s " , dstPath )
124
124
125
125
return nil
126
126
}
@@ -136,7 +136,7 @@ func (c *migrateCommand) preRunE(cmd *cobra.Command, _ []string) error {
136
136
os .Exit (exitcodes .NoConfigFileDetected )
137
137
}
138
138
139
- c .cmd . Println ("Validating v1 configuration file:" , usedConfigFile )
139
+ c .log . Infof ("Validating v1 configuration file: %s " , usedConfigFile )
140
140
141
141
err := validateConfiguration ("https://golangci-lint.run/jsonschema/golangci.v1.jsonschema.json" , usedConfigFile )
142
142
if err != nil {
@@ -154,6 +154,8 @@ func (c *migrateCommand) preRunE(cmd *cobra.Command, _ []string) error {
154
154
}
155
155
156
156
func (c * migrateCommand ) persistentPreRunE (_ * cobra.Command , args []string ) error {
157
+ c .log .SetLevel (logutils .LogLevelInfo )
158
+
157
159
c .log .Infof ("%s" , c .buildInfo .String ())
158
160
159
161
loader := config .NewBaseLoader (c .log .Child (logutils .DebugKeyConfigReader ), c .viper , c .opts .LoaderOptions , c .cfg , args )
@@ -170,7 +172,7 @@ func (c *migrateCommand) backupConfigurationFile(srcPath string) error {
170
172
filename := strings .TrimSuffix (filepath .Base (srcPath ), filepath .Ext (srcPath )) + ".bck" + filepath .Ext (srcPath )
171
173
dstPath := filepath .Join (filepath .Dir (srcPath ), filename )
172
174
173
- c .cmd . Println ("Saving the v1 configuration to:" , dstPath )
175
+ c .log . Infof ("Saving the v1 configuration to: %s " , dstPath )
174
176
175
177
stat , err := os .Stat (srcPath )
176
178
if err != nil {
0 commit comments