@@ -18,8 +18,10 @@ import ( |
18 | 18 | ) |
19 | 19 |
|
20 | 20 | type logOptions struct { |
21 | | - Follow bool `json:"follow"` |
22 | | - Lines int `json:"lines"` |
| 21 | + Follow bool `json:"follow"` |
| 22 | + Lines int `json:"lines"` |
| 23 | + Timestamps bool `json:"timestamps"` |
| 24 | + Since string `json:"since"` |
23 | 25 | } |
24 | 26 |
|
25 | 27 | var loggerFactory = logger.NewColorLoggerFactory() |
@@ -196,8 +198,10 @@ func logsCommand(ctx *cli.Context) error { |
196 | 198 | } |
197 | 199 |
|
198 | 200 | payload := logOptions{ |
199 | | - Follow: ctx.Bool("follow"), |
200 | | - Lines: ctx.Int("tail"), |
| 201 | + Follow: ctx.Bool("follow"), |
| 202 | + Lines: ctx.Int("tail"), |
| 203 | + Timestamps: ctx.Bool("timestamps"), |
| 204 | + Since: ctx.String("since"), |
201 | 205 | } |
202 | 206 |
|
203 | 207 | payloadJSON, err := json.Marshal(payload) |
@@ -241,7 +245,18 @@ func doLog(wsURL string) error { |
241 | 245 | if nil != err { |
242 | 246 | return err |
243 | 247 | } |
244 | | - fmt.Println(string(buf)) |
| 248 | + // The websocket frame has "0* " to start the log, drop that to match UI |
| 249 | + pieces := strings.SplitN(string(buf), " ", 2) |
| 250 | + var log string |
| 251 | + if len(pieces) == 2 { |
| 252 | + log = pieces[1] |
| 253 | + } else { |
| 254 | + log = pieces[0] |
| 255 | + } |
| 256 | + if !strings.HasSuffix(log, "\n") { |
| 257 | + log = log + "\n" |
| 258 | + } |
| 259 | + fmt.Print(log) |
245 | 260 | } |
246 | 261 | } |
247 | 262 |
|
|