Update request_logger.py#10009
Closed
deshudiosh wants to merge 1 commit intoComfy-Org:masterfrom
Closed
Conversation
Saving api logs failed when Seedream4 official template was used on windows machine, due to the forbidden "=?:" characters in the filename, as well as the filename being too long. Regex keeps only usable characters, and 220 arbitrary max filename length is added.
Contributor
|
@Kosinkadink initial problem is in that the logger attach all headers to the path: Maybe better to completely rewrite that to fix the root issue? |
webfiltered
reviewed
Sep 30, 2025
| log_dir = get_log_directory() | ||
| timestamp = datetime.datetime.now().strftime("%Y%m%d_%H%M%S_%f") | ||
| filename = f"{timestamp}_{operation_id.replace('/', '_').replace(':', '_')}.log" | ||
| safe_operation_id = re.sub(r'[^A-Za-z0-9._-]', '_', operation_id) |
Contributor
There was a problem hiding this comment.
Any reason to strip everything instead of just the illegal characters?
*/:\"<|>?
Author
There was a problem hiding this comment.
Nope, I am just a noob and this is the first idea I got that solved it for me.
Contributor
There was a problem hiding this comment.
In that case, welcome, and thank you for the contribution. =)
Member
|
Yeah, for this one I'd say strip it so that the headers are not part of the name, will be much cleaner. |
Member
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Fix for "Error writing API log to: ......"
Saving api logs failed when Seedream4 official template was used on windows machine, due to the forbidden "=?:" characters in the filename, as well as the filename being too long.
Regex keeps only usable characters, and 220 arbitrary max filename length is added.