-
Notifications
You must be signed in to change notification settings - Fork 522
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Configuring command line options for "View Logs" command #1505
Comments
@luka-zitnik We're always appreciative of PRs! That said, I think we'd want to have some design discussion around how best to allow the user to configure their container log preferences. Adding a configuration setting that's simply appended to the It may make sense to have more specific configuration settings (e.g. "Docker log mode" = [All|Tail] and "Docker tail lines" = [1...n]) and use that to build an appropriate command line. That makes configuration more approachable for users, as well as making it easier to reconcile those settings with any changes to logging behavior and defaults in the future. |
Thx @philliphoff I do see that as a more correct approach. |
Adds two configuration options, Follow and Tail, that match -f and --tail command line arguments of "docker logs" command. Closes microsoft#1505.
Adds two configuration options, Follow and Tail, that match -f and --tail command line arguments of "docker logs" command. Closes microsoft#1505.
@luka-zitnik We've posted our proposal for a broader effort to support customization of Docker (CLI) commands used by the extension. See #1596 and let us know if you have any feedback. In particular, you'll notice that the team landed on a more direct form of customization that what we had discussed above (which had its own merits and drawbacks), in the interests of ensuring that users with very specific needs could do literally anything they needed to do, but perhaps at the cost of requiring that user to be more familiar with the Docker CLI and with some back-compatibility risk as the extension needs to tweak the commands it makes for whatever purpose. |
The proposal is awesome @philliphoff . Love the idea of templates and generated/supported tokens. Previously I thought it would be unrealistic to even talk about ability to call docker-compose instead of docker for its output style. But what did I know. |
@luka-zitnik I'll close this issue for now as a "dupe" of #1596 so that we can track everything related to command customization in one place. "View Logs" is definitely going to be included in that effort. |
Currently, using "View Logs" command means the whole log will be printed to the terminal. It's too much time to wait. Enough to categorize it as a bug. I'd love to be able to tail the log to e.g. 5 lines.
I imagine something like this in viewContainerLogs.ts:
terminal.sendText(`docker logs ${options} ${node.containerId}`);
or justterminal.sendText(`docker logs -f --tail=5 ${node.containerId}`);
I'm willing to submit a pr for this.
The text was updated successfully, but these errors were encountered: