Merge lp:~chipaca/ubuntu-push/logging-is-for-the-birds-tweet-tweet into lp:ubuntu-push/automatic

Proposed by John Lenton on 2014-11-05
Status: Merged
Approved by: John Lenton on 2014-11-05
Approved revision: 345
Merged at revision: 350
Proposed branch: lp:~chipaca/ubuntu-push/logging-is-for-the-birds-tweet-tweet
Merge into: lp:ubuntu-push/automatic
Diff against target: 88 lines (+10/-10)
4 files modified
client/session/session.go (+3/-3)
debian/config.json (+1/-1)
launch_helper/kindpool.go (+3/-2)
launch_helper/legacy/legacy.go (+3/-4)
To merge this branch: bzr merge lp:~chipaca/ubuntu-push/logging-is-for-the-birds-tweet-tweet
Reviewer Review Type Date Requested Status
Samuele Pedroni 2014-11-05 Approve on 2014-11-05
Review via email: mp+240713@code.launchpad.net

Commit message

move logging to info; improve logging of legacy helper errors; switch some logs to error from debug

Description of the change

move logging to info; improve logging of legacy helper errors; switch some logs to error from debug

To post a comment you must log in.
Samuele Pedroni (pedronis) wrote :

looks good

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'client/session/session.go'
2--- client/session/session.go 2014-10-08 20:35:24 +0000
3+++ client/session/session.go 2014-11-05 12:16:21 +0000
4@@ -430,7 +430,7 @@
5 return err
6 }
7 sess.clearShouldDelay()
8- sess.Log.Debugf("broadcast chan:%v app:%v topLevel:%d payloads:%s",
9+ sess.Log.Infof("broadcast chan:%v app:%v topLevel:%d payloads:%s",
10 bcast.ChanId, bcast.AppId, bcast.TopLevel, bcast.Payloads)
11 if bcast.ChanId == protocol.SystemChannelId {
12 // the system channel id, the only one we care about for now
13@@ -438,7 +438,7 @@
14 sess.BroadcastCh <- sess.decodeBroadcast(bcast)
15 sess.Log.Debugf("sent bcast over")
16 } else {
17- sess.Log.Debugf("what is this weird channel, %#v?", bcast.ChanId)
18+ sess.Log.Errorf("what is this weird channel, %#v?", bcast.ChanId)
19 }
20 return nil
21 }
22@@ -468,7 +468,7 @@
23 if to == nil {
24 continue
25 }
26- sess.Log.Debugf("unicast app:%v msg:%s payload:%s",
27+ sess.Log.Infof("unicast app:%v msg:%s payload:%s",
28 notif.AppId, notif.MsgId, notif.Payload)
29 sess.Log.Debugf("sending ucast over")
30 sess.NotificationsCh <- AddressedNotification{to, notif}
31
32=== modified file 'debian/config.json'
33--- debian/config.json 2014-08-21 10:47:12 +0000
34+++ debian/config.json 2014-11-05 12:16:21 +0000
35@@ -12,7 +12,7 @@
36 "recheck_timeout": "10m",
37 "connectivity_check_url": "http://start.ubuntu.com/connectivity-check.html",
38 "connectivity_check_md5": "4589f42e1546aa47ca181e5d949d310b",
39- "log_level": "debug",
40+ "log_level": "info",
41 "fallback_vibration": {"pattern": [100, 100], "repeat": 2},
42 "fallback_sound": "sounds/ubuntu/notifications/Slick.ogg",
43 "poll_interval": "5m",
44
45=== modified file 'launch_helper/kindpool.go'
46--- launch_helper/kindpool.go 2014-08-20 12:42:51 +0000
47+++ launch_helper/kindpool.go 2014-11-05 12:16:21 +0000
48@@ -294,12 +294,13 @@
49 }
50 payload, err := ioutil.ReadFile(args.FileOut)
51 if err != nil {
52- pool.log.Errorf("unable to read output from helper: %v", err)
53+ pool.log.Errorf("unable to read output from %v helper: %v", args.AppId, err)
54 } else {
55+ pool.log.Infof("%v helper output: %#v", args.AppId, payload)
56 res := &HelperResult{Input: args.Input}
57 err = json.Unmarshal(payload, &res.HelperOutput)
58 if err != nil {
59- pool.log.Debugf("failed to parse HelperOutput from helper output: %v", err)
60+ pool.log.Errorf("failed to parse HelperOutput from %v helper output: %v", args.AppId, err)
61 } else {
62 pool.chOut <- res
63 }
64
65=== modified file 'launch_helper/legacy/legacy.go'
66--- launch_helper/legacy/legacy.go 2014-08-21 18:03:49 +0000
67+++ launch_helper/legacy/legacy.go 2014-11-05 12:16:21 +0000
68@@ -55,7 +55,7 @@
69 err error
70 }
71
72-func (lhl *legacyHelperLauncher) Launch(_, progname, f1, f2 string) (string, error) {
73+func (lhl *legacyHelperLauncher) Launch(appId, progname, f1, f2 string) (string, error) {
74 comm := make(chan msg)
75
76 go func() {
77@@ -78,9 +78,8 @@
78 p_err := cmd.Wait()
79 if p_err != nil {
80 // Helper failed or got killed, log output/errors
81- lhl.log.Errorf("Legacy helper failed: %v", p_err)
82- lhl.log.Errorf("Legacy helper failed. Stdout: %s", stdout)
83- lhl.log.Errorf("Legacy helper failed. Stderr: %s", stderr)
84+ lhl.log.Errorf("Legacy helper failed: appId: %v, helper: %v, pid: %v, error: %v, stdout: %#v, stderr: %#v.",
85+ appId, progname, id, p_err, stdout.String(), stderr.String())
86 }
87 lhl.done(id)
88 }()

Subscribers

People subscribed via source and target branches