scelis / twine

Twine is a command line tool for managing your strings and their translations.
Other
840 stars 151 forks source link

Quiet mode #236

Closed felipeplets closed 6 years ago

felipeplets commented 6 years ago

Hello Guys,

I'm using Twine version 1.0.2 in a CI environment and after the process I send a report with the output. Currently there are hundreds of lines "Adding new definition '****' to twine file." once I run the "twine generate-localization-file" command.

Is there a way to run twine in a "quiet mode" to not print any console message?

If not, the community agrees with a --quiet option?

All the best, Felipe

scelis commented 6 years ago

That's a decent feature request. For now, you can get something similar by appending > /dev/null 2>&1 to your twine command. For example:

twine generate-localization-file twine.txt en.strings > /dev/null 2>&1

felipeplets commented 6 years ago

Thanks @scelis, your solution worked well.

felipeplets commented 6 years ago

@scelis just for the sake of documentation:

scelis commented 6 years ago

@felipeplets These are all things you can do with standard shell commands:

https://askubuntu.com/a/625230

adrianokerbermenvia commented 6 years ago

@scelis I work with @felipeplets and testing with the redirection operators we found out that Twine is currently throwing both logs and errors to the error output (stderr).

As we understood the correct way to hide the output and keep the errors on the terminal (Hide stdout and show stderr) would be:

twine generate-localization-file twine.txt en.strings > /dev/null

Which means that the 1> (stdout) is being thrown to the null file. And 2> (stderr) as not defined will still be shown on terminal.

So the problem is that Twine is currently throwing everything to 2> (stderr) instead of dividing error and log.

scelis commented 6 years ago

@adrianokerbermenvia There definitely may be some improvements we can make around which messages go to stdout and which go to stderr. Are there any messages in particular that you feel are not properly categorized?

adrianokerbermenvia commented 6 years ago

@scelis the lines "Adding new definition '********' to twine file." cited by @felipeplets on the initial question. All this log is put to stderr, flooding the error and ofuscating the errors of parsing, etc.