~chipaca/ubuntu-push/session-refactor-001

« back to all changes in this revision

Viewing changes to server/acceptance/suites/helpers.go

  • Committer: Tarmac
  • Author(s): Samuele Pedroni (Canonical Services Ltd.)
  • Date: 2014-11-04 16:46:53 UTC
  • mfrom: (347.1.3 api-logs)
  • Revision ID: tarmac-20141104164653-cv2lbfd0gpkbtb02
[r=chipaca] add logging around incoming unicasts

Show diffs side-by-side

added added

removed removed

Lines of Context:
127
127
                                c.Log(info)
128
128
                                continue
129
129
                        }
 
130
                        if strings.HasPrefix(info, "DEBUG ") && !strings.HasPrefix(info, "DEBUG session(") {
 
131
                                // skip non session DEBUG logs
 
132
                                c.Log(info)
 
133
                                continue
 
134
                        }
130
135
                        logs <- info
131
136
                }
132
137
        }()
136
141
const (
137
142
        DevListeningOnPat  = "INFO listening for devices on "
138
143
        HTTPListeningOnPat = "INFO listening for http on "
139
 
        debugPrefix        = "DEBUG "
140
144
)
141
145
 
142
 
// ExtractListeningAddr goes over logs ignoring DEBUG lines
143
 
// until a line starting with pat and returns the rest of that line.
 
146
// ExtractListeningAddr goes over logs until a line starting with pat
 
147
// and returns the rest of that line.
144
148
func ExtractListeningAddr(c *C, logs <-chan string, pat string) string {
145
149
        for line := range logs {
146
 
                if strings.HasPrefix(line, debugPrefix) {
147
 
                        continue
148
 
                }
149
150
                if !strings.HasPrefix(line, pat) {
150
151
                        c.Fatalf("matching %v: %v", pat, line)
151
152
                }