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

Logging from editor script #4

Closed
Supamiu opened this issue Jul 4, 2024 · 1 comment
Closed

Logging from editor script #4

Supamiu opened this issue Jul 4, 2024 · 1 comment

Comments

@Supamiu
Copy link

Supamiu commented Jul 4, 2024

When creating a @tool script, it's not possible to access LogDuck as an autloaded script because it's missing the @tool decorator, showing a null error.

@ZeeWeasel
Copy link
Owner

Good catch! I didn't consider that someone would want to use it in an editor script.

It's a bit of an odd workaround, but I found a way to load the singleton in the editor like this:
godotengine/godot#4236 (comment)

The only issue is that get_stack(), if called in the editor, does not return anything. I still need to figure out how to read the classname from scripts in the editor or get the path of the script. Maybe someone else has an idea how to make that work for editor scripts!

ZeeWeasel added a commit that referenced this issue Jul 10, 2024
It is now possible to create a @tool script and call LogDuck #4
ZeeWeasel added a commit that referenced this issue Jul 10, 2024
It is now possible to create a @tool script and call LogDuck #4
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