(ctx context.Context, appName string, enable bool)
| 52 | } |
| 53 | |
| 54 | func RouterLogs(ctx context.Context, appName string, enable bool) error { |
| 55 | c, err := config.ScalingoClient(ctx) |
| 56 | if err != nil { |
| 57 | return errors.Wrapf(ctx, err, "fail to get Scalingo client") |
| 58 | } |
| 59 | |
| 60 | _, err = c.AppsRouterLogs(ctx, appName, enable) |
| 61 | if err != nil { |
| 62 | return errors.Wrapf(ctx, err, "fail to configure router-logs feature") |
| 63 | } |
| 64 | |
| 65 | var action string |
| 66 | if enable { |
| 67 | action = "enable" |
| 68 | } else { |
| 69 | action = "disable" |
| 70 | } |
| 71 | |
| 72 | io.Statusf("Router logs have been %sd on %s\n", action, appName) |
| 73 | return nil |
| 74 | } |
no test coverage detected