(app models.Application)
| 80 | } |
| 81 | |
| 82 | func (cmd *Logs) recentLogsFor(app models.Application) error { |
| 83 | cmd.ui.Say(T("Connected, dumping recent logs for app {{.AppName}} in org {{.OrgName}} / space {{.SpaceName}} as {{.Username}}...\n", |
| 84 | map[string]interface{}{ |
| 85 | "AppName": terminal.EntityNameColor(app.Name), |
| 86 | "OrgName": terminal.EntityNameColor(cmd.config.OrganizationFields().Name), |
| 87 | "SpaceName": terminal.EntityNameColor(cmd.config.SpaceFields().Name), |
| 88 | "Username": terminal.EntityNameColor(cmd.config.Username())})) |
| 89 | |
| 90 | messages, err := cmd.logsRepo.RecentLogsFor(app.GUID) |
| 91 | if err != nil { |
| 92 | return cmd.handleError(err) |
| 93 | } |
| 94 | |
| 95 | for _, msg := range messages { |
| 96 | cmd.ui.Say("%s", msg.ToLog(time.Local)) |
| 97 | } |
| 98 | return nil |
| 99 | } |
| 100 | |
| 101 | func (cmd *Logs) tailLogsFor(app models.Application) error { |
| 102 | onConnect := func() { |
no test coverage detected