Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect signature for logger call #118

Open
pmacdonald-falcons opened this issue Nov 15, 2024 · 1 comment
Open

Incorrect signature for logger call #118

pmacdonald-falcons opened this issue Nov 15, 2024 · 1 comment

Comments

@pmacdonald-falcons
Copy link

pmacdonald-falcons commented Nov 15, 2024

logger.debug("Refreshing the engine, previous context: '%r'", prev_context)

The string expansion here can be read as an argument here if custom handlers are added to the core handler. Update (and check all other apps and engines) for logger calls where the string is concatenated with "," rather than using fstring or % formatting.

logger.debug("Refreshing the engine, previous context: '%r'", prev_context)
should be
logger.debug("Refreshing the engine, previous context: '%r'" % prev_context)

Also here :

logger.debug("Extracted sgtk instance: '%r' from path: '%r'", tk, new_path)

@julien-lang
Copy link
Contributor

Hi @pmacdonald-falcons, thanks for reporting this issue.

I am not sure I understand the problem. From what I know, the Toolkit logger uses the Python logging module. And, according to the documentation, the % string formatting is supported with the function *args parameters:

The msg is the message format string, and the args are the arguments which are merged into msg using the string formatting operator.

Although, I am not sure what you mean by custom handlers so I might be missing something here. Please let me know.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants