Skip to content

Commit b285ee9

Browse files
dilyevskyneild
authored andcommitted
Log parsing errors using log pkg (#851)
* Log parsing errors using log pkg. * Run goimport.
1 parent e91709a commit b285ee9

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

proto/properties.go

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ package proto
3838
import (
3939
"fmt"
4040
"log"
41-
"os"
4241
"reflect"
4342
"sort"
4443
"strconv"
@@ -194,7 +193,7 @@ func (p *Properties) Parse(s string) {
194193
// "bytes,49,opt,name=foo,def=hello!"
195194
fields := strings.Split(s, ",") // breaks def=, but handled below.
196195
if len(fields) < 2 {
197-
fmt.Fprintf(os.Stderr, "proto: tag has too few fields: %q\n", s)
196+
log.Printf("proto: tag has too few fields: %q", s)
198197
return
199198
}
200199

@@ -214,7 +213,7 @@ func (p *Properties) Parse(s string) {
214213
p.WireType = WireBytes
215214
// no numeric converter for non-numeric types
216215
default:
217-
fmt.Fprintf(os.Stderr, "proto: tag has unknown wire type: %q\n", s)
216+
log.Printf("proto: tag has unknown wire type: %q", s)
218217
return
219218
}
220219

0 commit comments

Comments
 (0)