Skip to content

Commit

Permalink
feat: support specifying an ending time for PaaS logs
Browse files Browse the repository at this point in the history
  • Loading branch information
Kuruyia committed Dec 2, 2022
1 parent 657aa8f commit 95d7018
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/commands/paas/logs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,9 @@ class PaasLogs extends PaasKommand {
since: flags.string({
description: "Display logs from a specific absolute (e.g. 2022/12/02 09:41) or relative (e.g. a minute ago) time",
}),
until: flags.string({
description: "Display logs until a specific absolute (e.g. 2022/12/02 09:41) or relative (e.g. a minute ago) time",
}),
};

static args = [
Expand Down Expand Up @@ -106,6 +109,7 @@ class PaasLogs extends PaasKommand {

// Parse the time arguments
const since = this.flags.since ? chrono.parseDate(this.flags.since).toISOString() : undefined;
const until = this.flags.until ? chrono.parseDate(this.flags.until).toISOString() : undefined;

// Perform the streamed request
const incomingMessage = await this.paas.queryHttpStream({
Expand All @@ -118,6 +122,7 @@ class PaasLogs extends PaasKommand {
tailLines: this.flags.tail,
podName: this.flags.podName,
since,
until,
});

// Read the response line by line
Expand Down

0 comments on commit 95d7018

Please sign in to comment.