Skip to content

Commit 6d186d2

Browse files
committed
Add logging source flags
1 parent 9943627 commit 6d186d2

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

pkg/cmd/logs.go

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,11 @@ var logsCmd = cli.Command{
2424
Usage: "Number of lines to show from the end of the logs",
2525
Value: 100,
2626
},
27+
&cli.StringFlag{
28+
Name: "source",
29+
Aliases: []string{"s"},
30+
Usage: "Log source: app (default), vmm (Cloud Hypervisor), or hypeman (operations log)",
31+
},
2732
},
2833
Action: handleLogs,
2934
HideHelpCommand: true,
@@ -50,6 +55,9 @@ func handleLogs(ctx context.Context, cmd *cli.Command) error {
5055
if cmd.IsSet("tail") {
5156
params.Tail = hypeman.Opt(int64(cmd.Int("tail")))
5257
}
58+
if cmd.IsSet("source") {
59+
params.Source = hypeman.InstanceLogsParamsSource(cmd.String("source"))
60+
}
5361

5462
var opts []option.RequestOption
5563
if cmd.Root().Bool("debug") {
@@ -70,5 +78,3 @@ func handleLogs(ctx context.Context, cmd *cli.Command) error {
7078

7179
return stream.Err()
7280
}
73-
74-

0 commit comments

Comments
 (0)