Prettify console output message (#1396)

This commit is contained in:
Ta-Ching Chen
2019-11-10 16:42:34 +08:00
committed by GitHub
parent 7b6e4318d4
commit 7640f1199d
7 changed files with 51 additions and 35 deletions
@@ -45,7 +45,7 @@ func getPodFileName(dumpdir string, pod metav1.ObjectMeta, containerName string)
func writeToFile(file string, obj interface{}) {
bs, err := yaml.Marshal(obj)
if err != nil {
console.Info(fmt.Sprintf("Error encoding object: %v", err))
console.Error(fmt.Sprintf("Error encoding object: %v", err))
return
}
@@ -57,6 +57,6 @@ func writeToFile(file string, obj interface{}) {
err = ioutil.WriteFile(file, bs, 0644)
if err != nil {
console.Info(fmt.Sprintf("Error writing file %v: %v", file, err))
console.Error(fmt.Sprintf("Error writing file %v: %v", file, err))
}
}