cli: log resolved file output path #4336
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Streamlink currently doesn't log the full path when writing the output to a file. This is an issue when the output path is dynamically generated from the input argument via the stream's metadata, because the user doesn't know where the data was actually written to. The output path gets already logged if the file already exists, but that's not really helpful.
The log message added by this PR does only get printed if the stream is written to a file, and not to stdout via
--stdout
or--output=-
.I'm not sure though if we should put the path into quotes and escape it (via shlex.quote), because if there are spaces, it's not perfectly clear. It is however on a separate line in the output, so maybe it is. The file path in the confirm message could also be removed, but that would require the "Writing output to" message to be printed via
console.msg
and notlog.info
, because log messages can be suppressed whereas console messages can not.Thoughts?