peak / s5cmd

Parallel S3 and local filesystem execution tool.
MIT License
2.71k stars 239 forks source link

add `--log-stderr`: write log output to stderr #663

Open bsilverthorn opened 1 year ago

bsilverthorn commented 1 year ago

Especially if you're using s5cmd cat, this flag lets you see log output even when redirecting stdout.

denizsurmeli commented 1 year ago

Hello, thanks for the PR. It's a needed feature I believe, but do you think rather than a bool flag, would it be better to make a flag that takes a filepath and write logs to the described file. We can have STDOUT, STDERR as enums, so we can handle those cases too. Something like this seemed feasible:

s5cmd --log-output=STDERR cat "s3://bucket/object"
s5cmd --log-output="debug.log" cat "s3://bucket/object"

Would like your comment on this approach. Obviously, we can direct STDERR and STDOUT to any file with redirection with your approach.