Skip to content

Commit be642b6

Browse files
committed
Use logrus for minification error logging
1 parent 5b7f364 commit be642b6

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

compiler/prelude/prelude.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ package prelude
22

33
import (
44
_ "embed"
5-
"log"
65

76
"github.com/evanw/esbuild/pkg/api"
7+
log "github.com/sirupsen/logrus"
88
)
99

1010
// Prelude is the GopherJS JavaScript interop layer.
@@ -36,13 +36,13 @@ func Minified() string {
3636
LegalComments: api.LegalCommentsEndOfFile,
3737
})
3838
for _, w := range result.Warnings {
39-
log.Printf("WARNING %d:%d: %s\n%s\n", w.Location.Line, w.Location.Column, w.Text, w.Location.LineText)
39+
log.Warnf("%d:%d: %s\n%s\n", w.Location.Line, w.Location.Column, w.Text, w.Location.LineText)
4040
}
4141
if errCount := len(result.Errors); errCount > 0 {
4242
for _, e := range result.Errors {
43-
log.Printf("ERROR %d:%d: %s\n%s\n", e.Location.Line, e.Location.Column, e.Text, e.Location.LineText)
43+
log.Errorf("%d:%d: %s\n%s\n", e.Location.Line, e.Location.Column, e.Text, e.Location.LineText)
4444
}
45-
log.Fatalf("JS minification failed with %d errors", errCount)
45+
log.Fatalf("Prelude minification failed with %d errors", errCount)
4646
}
4747
return string(result.Code)
4848

0 commit comments

Comments
 (0)