grim/convey

2bd4e1d52ec3
Parents 3e9d186c4b1a
Children b0d91bc834b6
Use the log instead of fmt.Printf for workspace errors
--- a/workspace/workspace.go Sun Jul 28 23:08:13 2019 -0500
+++ b/workspace/workspace.go Sun Jul 28 23:08:33 2019 -0500
@@ -17,10 +17,11 @@
package workspace
import (
- "fmt"
"io/ioutil"
"os"
"path/filepath"
+
+ log "github.com/sirupsen/logrus"
)
type Workspace struct {
@@ -60,14 +61,14 @@
func (ws *Workspace) Destroy() {
if err := os.RemoveAll(ws.path); err != nil {
- fmt.Printf("error removing worksace: %s\n", err)
+ log.Errorf("error removing worksace: %s\n", err)
}
// try to remove the .convey directory. This will only succeed when
// our state is the only one and that's intentional.
dir := filepath.Dir(ws.path)
if err := os.Remove(dir); err != nil {
- fmt.Printf("error removing .convey: %s\n", err)
+ log.Errorf("error removing .convey: %s\n", err)
}
}