MCPcopy
hub / github.com/cloudfoundry/cli / ReturnLogs

Function ReturnLogs

command/v7/push_command_test.go:58–78  ·  view source on GitHub ↗
(logevents []LogEvent, passedWarnings v7action.Warnings, passedError error)

Source from the content-addressed store, hash-verified

56}
57
58func ReturnLogs(logevents []LogEvent, passedWarnings v7action.Warnings, passedError error) func(appName string, spaceGUID string, client sharedaction.LogCacheClient) (<-chan sharedaction.LogMessage, <-chan error, context.CancelFunc, v7action.Warnings, error) {
59 return func(appName string, spaceGUID string, client sharedaction.LogCacheClient) (<-chan sharedaction.LogMessage, <-chan error, context.CancelFunc, v7action.Warnings, error) {
60 logStream := make(chan sharedaction.LogMessage)
61 errStream := make(chan error)
62 go func() {
63 defer close(logStream)
64 defer close(errStream)
65
66 for _, log := range logevents {
67 if log.Log != nil {
68 logStream <- *log.Log
69 }
70 if log.Error != nil {
71 errStream <- log.Error
72 }
73 }
74 }()
75
76 return logStream, errStream, func() {}, passedWarnings, passedError
77 }
78}
79
80var _ = Describe("push Command", func() {
81 var (

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected