Skip to content

Commit fbc789a

Browse files
committed
internal/*: use logrus instead of std log
1 parent 5c49d6b commit fbc789a

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

internal/util/fileutil/file_util.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,11 @@ package fileutil
1919
import (
2020
"fmt"
2121
"io"
22-
"log"
2322
"os"
2423
"path/filepath"
2524
"sync"
2625

26+
log "github.com/sirupsen/logrus"
2727
"github.com/spf13/afero"
2828
)
2929

internal/util/projutil/project_util.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,11 @@
1515
package projutil
1616

1717
import (
18-
"log"
1918
"os"
2019
"path/filepath"
2120
"strings"
21+
22+
log "github.com/sirupsen/logrus"
2223
)
2324

2425
const (
@@ -48,7 +49,7 @@ func MustInProjectRoot() {
4849
// we are at the project root.
4950
_, err := os.Stat(buildDockerfile)
5051
if err != nil && os.IsNotExist(err) {
51-
log.Fatalf("must run command in project root dir: %v", err)
52+
log.Fatalf("must run command in project root dir: (%v)", err)
5253
}
5354
}
5455

@@ -65,7 +66,7 @@ func MustGetwd() string {
6566
func CheckAndGetCurrPkg() string {
6667
gopath := os.Getenv(GopathEnv)
6768
if len(gopath) == 0 {
68-
log.Fatalf("get current pkg failed: GOPATH env not set")
69+
log.Fatal("get current pkg failed: GOPATH env not set")
6970
}
7071
var goSrc string
7172
cwdInGopath := false
@@ -79,7 +80,7 @@ func CheckAndGetCurrPkg() string {
7980
}
8081
}
8182
if !cwdInGopath {
82-
log.Fatalf("check current pkg failed: must run from gopath")
83+
log.Fatal("check current pkg failed: must run from gopath")
8384
}
8485
currPkg := strings.Replace(wd, goSrc+string(filepath.Separator), "", 1)
8586
// strip any "/" prefix from the repo path.

0 commit comments

Comments
 (0)