@@ -51,6 +51,8 @@ func newMigrateCommand(log logutils.Log, info BuildInfo) *migrateCommand {
51
51
log : log ,
52
52
}
53
53
54
+ log .SetLevel (logutils .LogLevelInfo )
55
+
54
56
migrateCmd := & cobra.Command {
55
57
Use : "migrate" ,
56
58
Short : "Migrate configuration file from v1 to v2" ,
@@ -98,7 +100,7 @@ func (c *migrateCommand) execute(_ *cobra.Command, _ []string) error {
98
100
return err
99
101
}
100
102
101
- c .cmd . Println ("Migrating v1 configuration file:" , srcPath )
103
+ c .log . Infof ("Migrating v1 configuration file: %s " , srcPath )
102
104
103
105
ext := filepath .Ext (srcPath )
104
106
if strings .TrimSpace (c .opts .format ) != "" {
@@ -120,7 +122,7 @@ func (c *migrateCommand) execute(_ *cobra.Command, _ []string) error {
120
122
return fmt .Errorf ("saving configuration file: %w" , err )
121
123
}
122
124
123
- c .cmd . Println ("Migration done:" , dstPath )
125
+ c .log . Infof ("Migration done: %s " , dstPath )
124
126
125
127
return nil
126
128
}
@@ -136,7 +138,7 @@ func (c *migrateCommand) preRunE(cmd *cobra.Command, _ []string) error {
136
138
os .Exit (exitcodes .NoConfigFileDetected )
137
139
}
138
140
139
- c .cmd . Println ("Validating v1 configuration file:" , usedConfigFile )
141
+ c .log . Infof ("Validating v1 configuration file: %s " , usedConfigFile )
140
142
141
143
err := validateConfiguration ("https://golangci-lint.run/jsonschema/golangci.v1.jsonschema.json" , usedConfigFile )
142
144
if err != nil {
@@ -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