DekodeInteraktiv / anonymize-mysqldump

Allows you to pipe data from mysqldump or an SQL file and anonymize it.
GNU General Public License v3.0
16 stars 8 forks source link

Piping Output & Errors #5

Closed PeterBooker closed 2 years ago

PeterBooker commented 2 years ago

Currently the tool is designed to be used piping the output to a file like so mysqldump -u yada -pbadpass -h db | anonymize-mysqldump --config config.json > anonymized.sql. This causes an issue where any errors/notices are also piped to the resulting file.

Would it be better to have a default path to output the file to, which can be overridden or require an output path in the command? Perhaps like mysqldump -u yada -pbadpass -h db | anonymize-mysqldump --config config.json -o anonymized.sql?

PeterBooker commented 2 years ago

Things output to os.Stderr, like our error messages, do not get piped to the output file. So this issue can be resolved in our logging implementation.