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

fix/send normal output to stderr #194

Merged
merged 4 commits into from
Dec 5, 2023
Merged

Conversation

kjuulh
Copy link
Contributor

@kjuulh kjuulh commented Nov 22, 2023

This pr redirects all output to be send via. stderr in ui.UI instead of stdout.

Stdout is supposed to be used for programs which should pipe to other programs.

Stderr, is supposed to be used for giving information to the user about the process. As such I've taken the libery of changing the shell.go exec from Errorln -> Infoln. This should remove the red text, as the output is technically not an error.


@kjuulh :
what are stdout and stderr supposed to be used for?

chatgpt:
stdout (standard output) and stderr (standard error) are two separate output streams used in computer programming, especially in Unix-like operating systems. They serve different purposes:

  1. stdout (Standard Output): This is the default output stream for data (like text) that a program is designed to produce. In most cases, this data is the main output of the program. For example, if you run a program to calculate something, the result of the calculation would be sent to stdout.
  2. stderr (Standard Error): This is used specifically for outputting error messages and diagnostics. It's separate from `stdout so that error messages can be handled differently. For example, in a logging system, you might want to capture errors separately from regular output for debugging purposes.

Separating these streams allows for more flexible handling of output. For instance, in a Unix command line, you can redirect stdout to a file, while still viewing stderr on the terminal, or vice versa. This separation is useful in debugging and log management in software development.

@kjuulh kjuulh requested a review from a team as a code owner November 22, 2023 14:58
@github-actions github-actions bot added the patch label Nov 22, 2023
@kjuulh kjuulh linked an issue Nov 22, 2023 that may be closed by this pull request
Signed-off-by: Kasper J. Hermansen <contact@kjuulh.io>
Signed-off-by: Kasper J. Hermansen <contact@kjuulh.io>
@kjuulh kjuulh force-pushed the fix/send-normal-output-to-stderr branch from 285f70a to 276de0c Compare November 24, 2023 09:27
Signed-off-by: Kasper J. Hermansen <contact@kjuulh.io>
Signed-off-by: Kasper J. Hermansen <contact@kjuulh.io>
@kjuulh kjuulh merged commit d2da666 into master Dec 5, 2023
2 checks passed
@kjuulh kjuulh deleted the fix/send-normal-output-to-stderr branch December 5, 2023 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Shuttle runs plan pull on all commands, also shuttle get
2 participants