@@ -222,6 +222,10 @@ func (g *GitHubRepo) getOrCreateLabel(id int64) *GitHubLabel {
222
222
return lb
223
223
}
224
224
225
+ func (g * GitHubRepo ) verbose () bool {
226
+ return g .github != nil && g .github .c != nil && g .github .c .verbose
227
+ }
228
+
225
229
// GitHubUser represents a GitHub user.
226
230
// It is a subset of https://developer.github.com/v3/users/#get-a-single-user
227
231
type GitHubUser struct {
@@ -550,7 +554,9 @@ func (r *GitHubRepo) newGithubReview(p *maintpb.GithubReview) *GitHubReview {
550
554
if len (p .OtherJson ) > 0 {
551
555
// TODO: parse it and see if we've since learned how
552
556
// to deal with it?
553
- log .Printf ("Unknown JSON in log: %s" , p .OtherJson )
557
+ if r .verbose () {
558
+ log .Printf ("newGithubReview: unknown JSON in log: %s" , p .OtherJson )
559
+ }
554
560
e .OtherJSON = string (p .OtherJson )
555
561
}
556
562
@@ -702,7 +708,9 @@ func (r *GitHubRepo) newGithubEvent(p *maintpb.GithubIssueEvent) *GitHubIssueEve
702
708
if len (p .OtherJson ) > 0 {
703
709
// TODO: parse it and see if we've since learned how
704
710
// to deal with it?
705
- log .Printf ("Unknown JSON in log: %s" , p .OtherJson )
711
+ if r .verbose () {
712
+ log .Printf ("newGithubEvent: unknown JSON in log: %s" , p .OtherJson )
713
+ }
706
714
e .OtherJSON = string (p .OtherJson )
707
715
}
708
716
if p .Label != nil {
@@ -985,10 +993,6 @@ type githubIssueDiffer struct {
985
993
b * github.Issue // may NOT be nil
986
994
}
987
995
988
- func (d githubIssueDiffer ) verbose () bool {
989
- return d .gr .github != nil && d .gr .github .c != nil && d .gr .github .c .verbose
990
- }
991
-
992
996
// returns nil if no changes.
993
997
func (d githubIssueDiffer ) Diff () * maintpb.GithubIssueMutation {
994
998
var changed bool
@@ -1000,7 +1004,7 @@ func (d githubIssueDiffer) Diff() *maintpb.GithubIssueMutation {
1000
1004
}
1001
1005
for _ , f := range issueDiffMethods {
1002
1006
if f (d , m ) {
1003
- if d .verbose () {
1007
+ if d .gr . verbose () {
1004
1008
fname := strings .TrimPrefix (runtime .FuncForPC (reflect .ValueOf (f ).Pointer ()).Name (), "golang.org/x/build/maintner.githubIssueDiffer." )
1005
1009
log .Printf ("Issue %d changed: %v" , d .b .GetNumber (), fname )
1006
1010
}
0 commit comments