Skip to content

Commit 625f691

Browse files
committed
add --since and --until to logs command
1 parent 4c4440d commit 625f691

File tree

3 files changed

+12
-1
lines changed

3 files changed

+12
-1
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
## {{ UNRELEASED_VERSION }} - [{{ UNRELEASED_DATE }}]({{ UNRELEASED_LINK }})
22

33
* Added `--tail` option to `lando logs` command to allow users to specify the number of lines to show from the end of the logs for each service
4+
* Added `--since` and `--until` options to `lando logs` command to allow users to specify a range of logs to show
45

56
## v3.24.0-beta.12 - [January 24, 2025](https://github.com/lando/core/releases/tag/v3.24.0-beta.12)
67

lib/compose.js

+2
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,10 @@ const composeFlags = {
1818
recreate: '--force-recreate',
1919
removeOrphans: '--remove-orphans',
2020
rm: '--rm',
21+
since: '--since',
2122
tail: '--tail',
2223
timestamps: '--timestamps',
24+
until: '--until',
2325
volumes: '-v',
2426
};
2527

tasks/logs.js

+9-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ module.exports = lando => ({
2323
alias: ['s'],
2424
array: true,
2525
},
26+
since: {
27+
describe: 'Show logs since timestamp (e.g. 2025-01-02T13:23:37Z) or relative (e.g. 42m for 42 minutes)',
28+
type: 'string',
29+
},
2630
tail: {
2731
describe: 'Number of lines to show from the end of the logs for each service',
2832
alias: ['n'],
@@ -35,11 +39,15 @@ module.exports = lando => ({
3539
default: false,
3640
boolean: true,
3741
},
42+
until: {
43+
describe: 'Show logs before timestamp (e.g. 2025-01-02T13:23:37Z) or relative (e.g. 42m for 42 minutes)',
44+
type: 'string',
45+
},
3846
},
3947
run: options => {
4048
// Try to get our app
4149
const app = lando.getApp(options._app.root);
42-
const opts = _.pick(options, ['follow', 'tail', 'timestamps', 'service']);
50+
const opts = _.pick(options, ['follow', 'tail', 'timestamps', 'service', 'since', 'until']);
4351
opts.services = opts.service;
4452
if (app) return app.init().then(() => lando.engine.logs(_.merge(app, {opts})));
4553
},

0 commit comments

Comments
 (0)