Skip to content
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

Allow customising number of lines shown before <n lines omitted> #180

Open
gibfahn opened this issue Aug 14, 2023 · 5 comments
Open

Allow customising number of lines shown before <n lines omitted> #180

gibfahn opened this issue Aug 14, 2023 · 5 comments

Comments

@gibfahn
Copy link

gibfahn commented Aug 14, 2023

Often in CI I find the important details are lost behind:

```
<72 lines omitted>
```

this makes it hard to debug issues. It would be great to have an environment variable or similar to customise how much is printed.

@epage
Copy link
Contributor

epage commented Aug 16, 2023

I've been hesitant to include env variables for controlling things, so far. Unsure if I'm more open to that or a feature flag.

@gibfahn
Copy link
Author

gibfahn commented Aug 31, 2023

A feature flag that disables truncating would be great for me if that works for you.

@epage
Copy link
Contributor

epage commented Aug 31, 2023

I'm also not a big fan of feature flags, so that was a bit of "which evil do I prefer?"

@gibfahn
Copy link
Author

gibfahn commented Sep 5, 2023

Fair enough.

I keep hitting issues where truncated output hides the key details of what went wrong in CI, so I'm also weighing up using a git fork (not ideal) vs not using the crate, vs waiting for this to be an option.

I guess this could also be a set of options on the Command struct, so I could do something like:

let mut cmd = Command::cargo_bin("mycli")?;
cmd.truncate(false);
// ...

@gibfahn
Copy link
Author

gibfahn commented Sep 25, 2023

An alternative would be an option to print the full stdout and stderr to a temp file somewhere, so when the output is small one could just see it inline, but when it is large one could go find it if needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants