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

Make errorMessage write to stderr #34

Open
sras opened this issue Jun 19, 2020 · 1 comment
Open

Make errorMessage write to stderr #34

sras opened this issue Jun 19, 2020 · 1 comment

Comments

@sras
Copy link

sras commented Jun 19, 2020

No description provided.

@sras sras changed the title Make errorMessage write to stderr #3 Make errorMessage write to stderr Jun 19, 2020
sras added a commit to sras/colourista that referenced this issue Jun 19, 2020
sras added a commit to sras/colourista that referenced this issue Jun 19, 2020
Adds a variant of formattedMessage that writes to stderr and use it in
the implementation of errorMessage function

Resolves kowainik#34
@chshersh
Copy link
Contributor

Hi @sras, thanks for your interest in colourista. Before going directly to the implementation, I would like to tell vision about the subject.

The fact that you print something to stderr doesn't mean that it is an error. The name of the stderr is unfortunate. Still, one of the main usages for stderr is to print some debugging or logging information in there, so you can safely pipe the output of your tools to other CLI consumers without the need for them to handle diverse format of all logging messages. In this context, making only errorMessage print to stderr and not other functions seems a bit inconsistent with the general idea.

I don't mind introducing new functions like formattedMessageStderr and formattedMessageHandle to give more flexibility to users. But regarding output handle for all functions — this requires some thinking and discussions. @vrom911 and I were thinking about possible solutions for this problem and how to give more flexibility to users by providing the consistent interface at the same time. I guess, the latter issue will take some time, but two helpful functions (which I mentioned above) can be added to the library meanwhile 🙂

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

Successfully merging a pull request may close this issue.

2 participants